Ticker

6/recent/ticker-posts

How to freeze rails application

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

 

Post a Comment

1 Comments

  1. With rails 3 it's "bundle" command these days...
    http://betterlogic.com/roger/2011/04/rails-freeze-rails-3/

    ReplyDelete