rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

jets server in Cloud9 #201

Closed lefthand closed 5 years ago

lefthand commented 5 years ago

Checklist

My Environment

Software Version
Operating System Amazon Linux
Jets 1.8.5
Ruby 2.5.1

Expected Behaviour

I would like to run jets server --port 8080 in Cloud9 to run a preview version of the site before deploy.

Current Behavior

The local server fails with a NoMethodError on lib/jets/controller/middleware/main.rb: in setup, line 35

Step-by-step reproduction instructions

Code Sample

NoMethodError at /
undefined method `request' for nil:NilClass

Ruby | /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/jets-1.8.5/lib/jets/controller/middleware/main.rb: in setup, line 35
Traceback (innermost first)

    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/jets-1.8.5/lib/jets/controller/middleware/main.rb: in setup
              @controller.request.set_env!(@env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/jets-1.8.5/lib/jets/controller/middleware/main.rb: in call!
              setup...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/jets-1.8.5/lib/jets/controller/middleware/main.rb: in call
              dup.call!...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/jets-1.8.5/lib/jets/controller/middleware/main.rb: in call
              instance.call...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/bundler/gems/webpacker-3651cc317358/lib/webpacker/dev_server_proxy.rb: in perform_request
              @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-proxy-0.6.5/lib/rack/proxy.rb: in call
              rewrite_response(perform_request(rewrite_env(env)))...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/etag.rb: in call
              status, headers, body = @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/conditional_get.rb: in call
                status, headers, body = @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/head.rb: in call
              status, headers, body = @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/session/abstract/id.rb: in context
                  status, headers, body = app.call(req.env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/session/abstract/id.rb: in call
                  context(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/jets-1.8.5/lib/jets/controller/middleware/local.rb: in call
                @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/method_override.rb: in call
              @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/runtime.rb: in call
              status, headers, body = @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/jets-1.8.5/lib/jets/middleware.rb: in call
              stack.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/lint.rb: in _call
              status, headers, @body = @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/lint.rb: in call
              dup._call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/show_exceptions.rb: in call
              @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/common_logger.rb: in call
              status, header, body = @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/shotgun-0.9.2/lib/shotgun/loader.rb: in proceed_as_child
              status, headers, body = assemble_app.call(@env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/shotgun-0.9.2/lib/shotgun/loader.rb: in call!
                proceed_as_child...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/shotgun-0.9.2/lib/shotgun/loader.rb: in call
              dup.call!(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/shotgun-0.9.2/lib/shotgun/favicon.rb: in call
                app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/shotgun-0.9.2/lib/shotgun/static.rb: in call
                @app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/urlmap.rb: in block in call
                return app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/urlmap.rb: in each
              @mapping.each do |host, location, match, app|...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/urlmap.rb: in call
              @mapping.each do |host, location, match, app|...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/builder.rb: in call
              to_app.call(env)...
    /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/handler/webrick.rb: in service
                status, headers, body = @app.call(env)...
    /home/ec2-user/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/webrick/httpserver.rb: in service
              si.service(req, res)...
    /home/ec2-user/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/webrick/httpserver.rb: in run
                  server.service(req, res)...
    /home/ec2-user/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/webrick/server.rb: in block in start_thread
                  block ? block.call(sock) : run(sock)
tongueroo commented 5 years ago

@lefthand Thanks for the details in the bug report. Addressed in #202. Released in v1.8.6