简体   繁体   中英

Error when running Rails with Ruby 1.9.2 under RVM

When I try to run a Rails application when using Ruby 1.9.2 under RVM, I get the following error:

/Users/purinkle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [rake-0.9.2] (Gem::LoadError)
        from /Users/purinkle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
        from /Users/purinkle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1182:in `gem'
        from /Users/purinkle/.rvm/rubies/ruby-1.9.2-p290/bin/rails:18:in `<main>'

If I try to run the same command while using Ruby 1.8.7, everything works fine.

Why would this happen?

I am a newbie, but I can say you are missing the installation of Rails related to Ruby 1.9.2.

To check :

rails --version

To try solving this, reinstall rails for Ruby 1.9.2:

gem install rails

I had this same issue and it was as simple as

gem install rails

then

bundle update

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM