0

in my application, in the last few days, i'm unable to run the rails server/rails s or even bundle exec rails server command any more. it was running like a charm before.

i tried to revert the changes using git, but no luck, i tried all the possible proprieties i could think of. i use rubymine, but same problem when using the Terminal .

when i run:

ma@SL510:~/ts$ rails server

i get the following error stack trace :

from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392@global/gems/unicorn-4.6.2/lib/unicorn/http_request.rb:4:in `<top (required)>'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392@global/gems/unicorn-4.6.2/lib/unicorn.rb:103:in `<top (required)>'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
    from /home/ma/ts/config/application.rb:16:in `<top (required)>'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

i don't know how could i fix this, to get the rails server command to run again ! any help would be appreciate it !

ps: please tell me if i need to provide more info. Thanks.

Mawaheb
  • 822
  • 10
  • 21
  • Did you upgrade Ruby? – Justin D. Apr 03 '13 at 19:45
  • yes! it was on of the many things i did ! do you think this might be the reason ? i will try to reuse the old version and see. if that will fix it! – Mawaheb Apr 03 '13 at 19:48
  • I read on another thread that upgrading might cause the issue. If you are using RVM, it should be simple to revert. – Justin D. Apr 03 '13 at 20:12
  • Actually reverting to older version of ruby did not work, because in so many places of the code, the new ":" notation is used instead of the ": =>" – Mawaheb Apr 03 '13 at 21:27
  • 2
    Did you try to create a brand new gemset (and use it), then `bundle install` gems ? The stacktrace seems to indicate you're using the global gemset, which is a really bad idea. Another suggestion : IMO you should not use Unicorn with your development env. – Jef Apr 03 '13 at 21:58
  • @Jef thank you so much, creating a new gemset, and bundle install AND using gem install unicorn, fixed the problem ! can you please try to explain to me why using the global gemset is bad? it was the default setting in RubyMine, i did not change it. and why it's bad to use Unicorn in dev env? – Mawaheb Apr 04 '13 at 14:56
  • @Mawaheb Per-project gemsets allow you to manage your gems on a per-project basis, checkout https://rvm.io/rvm/best-practices/ (best practice #3). – Jef Apr 05 '13 at 09:38
  • Thanks alot @Jef , and if you want, you can write your comment that fixed my prblem as an answer, and i will choose it as right one and delete the one i posted myself :) thanks alot again . – Mawaheb Apr 05 '13 at 11:28

2 Answers2

1

Thanks to Jef creating a new gemset and using it and after this:

gem install unicorn 

fixed the problem with that command :)

Mawaheb
  • 822
  • 10
  • 21
0

You may try to create a brand new gemset (and use it), then bundle install so that Bundler install gems listed in your Gemfile. The stacktrace seems to indicate you're using the global gemset, which is a really bad idea.

Jef
  • 5,424
  • 26
  • 28