The Hitchhiker’s Guide to Ruby On Rails Galaxy

Records of my voyage through RoR Galaxy

How to freeze Rails application

Posted by arjunghosh on April 18, 2008

Rails is a moving target. Its core is constantly changing. So sometimes it is advisable to “freeze” your rails application so that even if you upgrade and install the latest new version of Rails, it does not break anything in your application.
So first change to your rails application directory:

cd testapp

Then run the following command to freeze this application to the version of Rails that is currently installed on your system:

rake rails:freeze:gems

Now to Unfreezing Rails:

rake rails:unfreeze

Now say you want to freeze to a different version of Rails.No worries. You can freeze to almost any version. This is how:

rake rails:freeze:edge TAG=rel_2-0-2

And to freeze Rails to the current development version:

rake rails:freeze:edge

Freezing helps us when we need to upgrade.For example, we have a Rails application of version 2.0.0 and froze it to that version. Now when Rails version 2.0.2 came out and say you wanted to upgarde, we can upgrade the frozen version of Rails by:

rake rails:freeze:edge TAG=rel_2-0-2

Now suppose after upgrading, you found that your application is not working properly with this new upgrade. So what do you do? Well not to worry. You can easily downgrade back to the previous version:

rake rails:freeze:edge TAG=rel_2-0-0

One Response to “How to freeze Rails application”

  1. pete said

    Freezing helps us when we need to upgrade.For example, we have a Rails application of version 2.0.0 and froze it to that version. Now when Rails version 2.0.2 came out and say you wanted to upgarde, we can upgrade the frozen version of Rails by:

    rake rails:freeze:edge TAG=rel_2-0-2

    It doesn’t look like this syntax works anymore; when I tried it, rails froze at edge (2.3.0 as of the time of writing).

    This command worked to freeze my app to a specific version:
    rake rails:freeze:edge RELEASE=2.1.2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: