views:

91

answers:

2

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??

A: 

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
shingara
I am using bundler in my Rails 2.3.8 app, and I ran "bundle install" with no problems. I still can not boot my app.
tubbo
A: 

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.

Scott Radcliff
rails -v reports "Rails 2.3.8", and my Gemfile.lock reports: "rails, actionmailer, actionpack, activerecord, activeresource and activesupport" all @ 2.3.8
tubbo
I did have a problem with Rails versions before and the only solution I could find was to uninstall Rails and reinstall the versions that I wanted through RVM. Hopefully someone has a better solution.
Scott Radcliff