Kyle
Kyle

Reputation: 947

Error with "rails -v"

I'm working on Mac Snow Leapord

Prior to installation of RVM, I have tried (but failed) upgrading OSX's default ruby.

Installation of Ruby was done with

rvm install 1.9.2

with ruby -v :

ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]

gem is 1.7.2 Installed rails with sudo gem install rails Rails installed with no errors prompted.

With rails -v :

/Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:926:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:244:in `activate_dep'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:236:in `activate'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:1307:in `gem'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/bin/rails:18:in `<main>'

I do have gem installed, otherwise I wouldn't have been able to do gem install rails

Does anyone knows the cause or a solution to this ?

Upvotes: 0

Views: 276

Answers (2)

stef
stef

Reputation: 14268

Do gem install rails (not sudo) to install for the current user?

Upvotes: 1

Brian
Brian

Reputation: 6840

The problem is that you used sudo to install rails when you are using rvm. Try this:

$ rvm use 1.9.2
$ gem install rails

HTH

Upvotes: 2

Related Questions