Upgrading to ruby โ€‹โ€‹1.9.3 with rvm breaks my rails application

I updated ruby โ€‹โ€‹using the following commands with rvm:

rvm get head rvm install 1.9.3 rvm reload rvm use 1.9.3 --default 

Now when I start the rails, I get the following error message:

 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem' from /usr/bin/rails:18 

If I run ruby, gem environment, and ruby โ€‹โ€‹-v, I get coherent output. Can someone help me understand what is happening with my application?

+4
source share
2 answers

Have you tried running gem install rails ?

Using RVM with ruby โ€‹โ€‹gemstones means that you can have binaries in your PATH (including the rails binary) for broken gemstones.

This is what your mistake looks like.

Hope bundle install or gem install rails fix your problem.

+2
source

You can restart the application by simply starting it:

 $ bundle 

To install the Gemfile dependencies. Then you should start the rails server with:

 $ bundle exec rails s 

It is important to use bundle exec to ensure that the rails command is run from the proper rail for your application.

If you need more information about this, Yehuda Katz has a detailed blog post: http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/

+1
source

Source: https://habr.com/ru/post/1379093/


All Articles