Choosing and Freezing a Rails Version

If you want to see what versions of Rails you have installed

gem list --local rails

If you want to install a version of Rails you don’t already have installed (assuming 2.2.3 is the version you don’t have installed)

gem install rails --version 2.2.3

If you want to start up your Rails app with a specific version (assumes you want to start up version 2.2.3)

rails _2.2.3_ --version

If you want to bind your Rails application to a specific Gem version of Rails

Edit your config/environment.rb file and modify the version of RAILS_GEM_VERSION to something else.
For example you can set RAILS_GEM_VERSION = "2.2.3"

If you want to freeze / tie your Rails application to a specific version of Rails, do the following:

cd your_rails_app

rake rails:freeze:gems

The above command copies the Rails files into your Rails’ application’s vendor/rails directory. When you start up Rails within your rails application directory, your application’s frozen version will be used instead of the your computer’s version.

To unfreeze your Rails version and go back to using your system-wide Gem version of Rails

cd your_rails_app

rake rails:unfreeze
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Facebook Twitter Email

Leave a Reply