views:

89

answers:

1

I recently upgraded a rails project I am working on from 2.0.5 to 2.3.2. I noticed that there was a local copy of the 2.0.5 rails files in vendor/rails and I was wondering should I put a local copy the 2.3.2 rails files in there too or just leave them out? What is considered a better practice?

+3  A: 

Yes. The copy of Rails that sits in vendor/rails is actually used in preference to the Rails gems installed system-wide—in other words, though you upgraded your Rails install, your app is actually still running on 2.0.5.

The vendor/rails directory exists so you can "freeze" your app to a specific version of Rails, thus making it less vulnerable to changes in the configuration of the machine it's running on. This is so darned useful that there's an automated way to manage the directory. To delete the existing version of Rails sitting in vendor/rails, go to the root of your Rails project directory and do the following:

rake rails:unfreeze

To then install the most current Rails gems on your system into vendor/rails, do:

rake rails:freeze:gems

There are a few other things you can do with vendor/rails. Check out rake -T for a full list of commands.

P.S. If you ever hear someone talk about their Rails install being "vendored", this is what they mean.

zbrimhall
Yea I noticed that it was using the local copy so I just simply removed the rails dir from vendor. Thanks for the answer.
AdamB