ysbaddaden / prax

Rack proxy server for development
http://ysbaddaden.github.io/prax/
Other
475 stars 49 forks source link

Prax giving "undefined method 'split' for nil:NilClass" #112

Closed mattlindsey closed 9 years ago

mattlindsey commented 9 years ago

Running prax on Ubuntu 14.04, ruby 2.1.5p273, rails 4.1.8. Getting following error on a freshly made app:

mlindsey@mlindsey-ubuntu ~ $ PRAX_DEBUG=1 prax start --foreground I, [2014-12-29T11:29:36.214409 #2866] INFO -- : Prax is ready to receive connections on :20559 and :20558. I, [2014-12-29T11:29:49.198394 #2866] INFO -- : Spawning application 'market-setup-api' [/home/mlindsey/git/market-setup-api] D, [2014-12-29T11:29:49.198592 #2866] DEBUG -- : ["/opt/prax/bin/racker", "--server", "/home/mlindsey/.prax/_sockets/market-setup-api.sock"] /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/spec_set.rb:92:in block in materialize': Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound) from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/spec_set.rb:85:inmap!' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/spec_set.rb:85:in materialize' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/definition.rb:132:inspecs' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/definition.rb:177:in specs_for' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/definition.rb:166:inrequested_specs' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/environment.rb:18:in requested_specs' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/runtime.rb:13:insetup' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler.rb:122:in setup' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/setup.rb:17:in<top (required)>' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in require' from /home/mlindsey/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:inrequire' E, [2014-12-29T11:29:59.191046 #2866] ERROR -- : NoMethodError: undefined method split' for nil:NilClass /opt/prax/lib/prax/request.rb:73:inhost' /opt/prax/lib/prax/handler.rb:57:in app_name' /opt/prax/lib/prax/handler.rb:17:inhandle' /opt/prax/lib/prax.rb:20:in perform' /opt/prax/lib/prax/microworker.rb:84:inblock in work' /opt/prax/lib/prax/microworker.rb:77:in each' /opt/prax/lib/prax/microworker.rb:77:inwork' /opt/prax/lib/prax/microworker.rb:63:in `block in spawn' I, [2014-12-29T11:29:59.191165 #2866] INFO -- : Respawning failed worker D, [2014-12-29T11:30:19.206112 #2866] DEBUG -- : Killing market-setup-api (2930)...

ysbaddaden commented 9 years ago

Bundler is complaining that it can"t find gems. Did you run bundle install or configured Prax for you Ruby version manager?

mattlindsey commented 9 years ago

Hi. I ran 'bundle install' for my app fine. Is that what you mean? And is starts fine on command line using 'bundle exec rails s'. Also not sure what you mean by 'configured Prox for your ruby version manager'. I installed prax according to instructions and ran './bin/prax install'.

mattlindsey commented 9 years ago

Hi again. I did run 'bundle install' successfully in /opt/prax, but same result.

ysbaddaden commented 9 years ago

Yes, I meant run bundle install for your application's server (Prax' Gemfile is just for running tests).

From the backtrace I notice you are using RVM, and you must configure Prax to handle it: https://github.com/ysbaddaden/prax/wiki/Ruby-Version-Managers#rvm

mattlindsey commented 9 years ago

Thanks. I didn't notice in the instructions that I had to configure Prax for RVM. It's working perfectly now.