0

rails server doesn't work with me, when I run rails s -p 3005, I got the following error:

Please report a bug if this causes problems.
/home/badrit-user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activated minitest 5.5.1, but your Gemfile requires minitest 4.7.5. Using bundle exec may solve this. (Gem::LoadError)
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `<top (required)>'
    from /home/badrit-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
    from /home/badrit-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
    from /home/badrit-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
    from /home/badrit-user/work/seeloz_mobile/config/boot.rb:4:in `<top (required)>'
    from /home/badrit-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:106:in `require'
    from /home/badrit-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:106:in `require'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@seeloz_mobile/gems/railties-4.1.8/lib/rails/app_rails_loader.rb:42:in `block in exec_app_rails'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@seeloz_mobile/gems/railties-4.1.8/lib/rails/app_rails_loader.rb:32:in `loop'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@seeloz_mobile/gems/railties-4.1.8/lib/rails/app_rails_loader.rb:32:in `exec_app_rails'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@seeloz_mobile/gems/railties-4.1.8/lib/rails/cli.rb:5:in `<top (required)>'
    from /home/badrit-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in `require'
    from /home/badrit-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in `require'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@seeloz_mobile/gems/railties-4.1.8/bin/rails:9:in `<top (required)>'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@seeloz_mobile/bin/rails:23:in `load'
    from /home/badrit-user/.rvm/gems/ruby-2.0.0-p247@seeloz_mobile/bin/rails:23:in `<main>'

And I checked my Gemfile.lock, I have already minitest (4.7.5).

It's weird, If I run this bundle exec rails s -p 3005, it's working, so Why this occurred ?

What's the solution to fix this issue ? (to run it using rails s)

Mohamed Yakout
  • 2,868
  • 1
  • 25
  • 45

2 Answers2

3

as you can see from error message Using bundle exec may solve this.

bundle exec rails s -p 3005

It's weird, If I run this bundle exec rails s -p 3005, it's working, so Why this occurred ?

Running a command with bundle exec at begin, launch gem what installed with a Gemfile from app directory, without bundle exec it is run gem what installed in to the system. As you can see you have success installed minitest 5.5.1 in system and minitest 4.7.5 in the Gemfile.

Ref

Roman Kiselenko
  • 43,210
  • 9
  • 91
  • 103
  • I agree with you, can I upgrade minitest in Gemfile to 5.5.1 instead of 4.7.5 ? .. it's typed in Gemfile.lock but not in Gemfile, it's installed as dependencies of another gem – Mohamed Yakout Jul 02 '15 at 13:07
  • [sure, look this answer.](http://stackoverflow.com/questions/11263150/update-just-one-gem-with-bundler) – Roman Kiselenko Jul 02 '15 at 13:09
1

If you’re not using bundler’s binstubs with RVM integration yet, you should give it a try!

This means you don’t have to type bundle exec ever again.

Setup:

  • One time, run chmod +x $rvm_path/hooks/after_cd_bundler
  • Once for each project, run bundle install -—binstubs
Loqman
  • 1,487
  • 1
  • 12
  • 24