简体   繁体   中英

Rails 2.3.8 application not booting after installing RVM

After installing Rails 3, RVM and Ruby 1.9.2, I've been having trouble running this Rails 2.3.8 app.

necromancer@factory$ script/server
./script/../config/boot.rb:5: uninitialized constant Rails (NameError)
 from script/server:2:in `require'
 from script/server:2

After running gem which rails , I got the following path:

/Users/necromancer/.rvm/gems/ruby-1.8.7-p302/gems/railties-3.0.0/lib/rails.rb

So I uninstalled railties-3.0.0 and ran gem install rails Now, gem which rails throws the following error:

ERROR:  Can't find ruby library file or shared library rails

I also tried uninstalling rails 2.3.8 and running bundle install within my app. Then I tried to gem uninstall rails and gem install rails -v=2.3.8 , and while the rails binary still works, gem which rails still throws this error. I think it may be the source of my problem...how do I get this to point to rails 2.3.8 on my rvm 1.8.7 gemset??

It's because you have conflict with Rails 2 and Rails 3.

You have 2 choices:

  • Use bundler in your rails 2.3 app
  • Use an rvm gemset independant between your rails 2 and rails 3 application

If you are using gemsets, run rails --version and make sure it is installed. It looks like a Rails 3 vs Rails 2.x issue to me.

Gemsets will save your sanity if you are not using them already.

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