Freezing Rails

From OCS Support Wiki

Jump to: navigation, search

[edit] Introduction

It's always a good idea to freeze Ruby on Rails on a deployment. This way the version of Rails you have developed with will be the one that is used for your application. You can avoid, and fix, many problems with Rails by doing this.

[edit] Rake Freeze

On your development machine, go to your Rails application folder and run:

rake rails:freeze:gems

to obtain the version of Rails that's on your computer. You can also specify a specific version of Rails like this:

rake rails:freeze:edge TAG=rel_1-2-6

Change the 1-2-6 to suit your version.

[edit] Manual Freezing

If the above command didn't work for you, on your development machine (or on our server, if you developed your app on our server), change into the directory that has your Rails application and run:

svn export http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-6/ vendor/rails

In this above example, we're freezing Rails 1.2.6, but you can put any version in there, like 2.0.2 or 1.1.6.

If you are using Subversion, you can run:

cd vendor
svn propset svn:externals "rails http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-6/" .
svn ci
svn up

Again, this example is for 1.2.6, but you can adjust the version as needed.