[x] Upgrade Jets: Are you using the latest version of Jets? This allows Jets to fix issues fast. There's a jets upgrade command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/
[x] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.rubyonjets.com
[x] Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.
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
Start a new Cloud9 host
Install and use Ruby 2.5
rvm install 2.5.1 && rvm use 2.5.1 --default
Install jets
gem install jets
Install yarn
npm install -g yarn
Install mysql client
sudo yum install mysql-devel
Start new project
jets new demo
Start the server on port 8080 as required by Cloud9
jets server --port 8080
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)
Checklist
jets upgrade
command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/My Environment
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
onlib/jets/controller/middleware/main.rb: in setup, line 35
Step-by-step reproduction instructions
rvm install 2.5.1 && rvm use 2.5.1 --default
gem install jets
npm install -g yarn
sudo yum install mysql-devel
jets new demo
jets server --port 8080
Code Sample