views:

298

answers:

3

For some reason when I run rails command, it installs 2.2.3 version of Rails in /vendor/rails and webbrick uses that version instead of 2.3.5 which is installed as a gem.

If I delete that, then it uses the right directory. I remember using git submodule once, but I don't think that has anything to do with this.

How can I correct this? Thanks

Edit:

I never installed Rails 2.2.3. Although I do vaguely remember using git submodule, if that helps anyone.

A: 

does the rails gem get vendored at the same time you create the app? that seems very strange if so.

if you are on linux or mac then it's possible you have something in your bash profile that's overriding the rails command. to be honest it sounds like a rails template is being run when you create your app....

failing that is it perhaps possible that you have something like 'instant rails' running on your machine and it's taking control instead of the rails gem?

very strange. what OS are you on? sometimes it helps to try creating a new user profile and seeing if you get the same problems when you login to that account....

stephenmurdoch
Thanks for your reply.I'm on Ubuntu (9.10). I created new user, but still it uses rails 2.2.3. I don't remember installing Instant rails or anything else like that. I loooked at my .bashrc and .gemrc, nothing out of ordinary there. It says 2.3.5 in my gem list, so I have no idea where its getting 2.2.3 from.
Senthil
+1  A: 

Check your local gems, and your system gems. Perhaps, you have it 2.2.3 installed in your user's bin.

Tyler
I did have some gems locally in /home/senthil/.gem/ruby/1.8/gems, but then I un installed everything from there. I don't think I had Rails in there to begin with. Besides I never installed Rails 2.2.3. I got into Rails only recently, definitely after 2.3.5 was released.
Senthil
try running '$ which rails' and '$ rails -v' for more information
Vestel
Actually you were Tyler. I looked at usr/bin/rails. Turns out there was a section where it copied Rails from another folder. I commented that out and commented another line in environment.rb and it works now. Thanks!
Senthil
+1  A: 

Try running:

rake rails::unfreeze

What's happening is 2.2.3 is getting frozen into your vendor directory.

As to why that's happening, I'm not sure. Be sure that you actually have 2.3.5. And unfreezing/refreezing should fix it.

rake rails::freeze::gems
Tyler Smith
Well I still have to go and manually update environment.rb. I want to be able to not get Rails 2.2.3 in my vendor when I do rails appname.
Senthil