4

I have upgraded 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 run rails s 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 which ruby, gem environment, and ruby -v I get coherent output. Could anyone help me understand what is going wrong with my application?

2 Answers 2

2

Have you tried running gem install rails?

Using RVM with ruby gems means you can have binaries in your PATH (including the rails binary) for gems that are not installed.

This is what your error looks like.

I hope a bundle install or gem install rails will fix your problem.

Sign up to request clarification or add additional context in comments.

4 Comments

I ran gem install rails, and then bundle install but now when I run rails s my command line gets an error and says there is a syntax error in my user model where there wasn't before.(it is saying that there is an unexpected keyword end at the end of my model, which makes no sense to me) I don't know if there is a conflict with devise, or I am just going crazy.
I think that's a different problem. If it's an "unexpected end" error it should be in the file the backtrace shows. If it worked in 1.9.2, I can't think of any syntax changes. Try swapping between the 2 and verifying you havent added a syntax error accidentally.
How do I swap between the two?
Nevermind I figured out the problem and there was an added comma to one of my files that didn't break in 1.9.2 but did in 1.9.3. I deleted it and now the app runs perfectly.
1

You should be able to get your app running again by simply running:

$ bundle 

To install your Gemfile dependencies. Then you should run rails server with:

$ bundle exec rails s 

It's important to use bundle exec in order to ensure the rails command is running from the proper rails gem for your application.

If you'd like more info on this Yehuda Katz has a detailed blog post: http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.