Skip to content

Why you should freeze Rails on a shared host environment

Posted on 31 March 2006

When you upload your site you need to run the freeze gems rake command. Freeze is cool according to David Heinemeier Hansson and it will ensure your site doesn't break if your host upgrades rails before you've had a chance to test it.

rake freeze_gems

Freezing your Rails basically puts the framework into vendor/rails instead of floating with whatever gems that are installed on the host.

Interestingly David has promised "The next version of Rails will by default extract the version of Rails it was created with into vendor/rails." So freezing your gems manually may only be around for a little while but it makes a lot of sense.

Remember that with your app using a fixed version of Rails you have to unfreeze it and freeze it again if your host has upgraded and you want to take advantage of the new Rails version.

rake unfreeze_rails

Update 09/06/07

Note that those two methods have now been deprecated. Whilst they still currently work you will get warning messages.

You should now be using:

rake rails:freeze:gems

rake rails:unfreeze

View the snippets archive ››

1 comment made

mahesh commented on 31 Aug 07 at 02:31

is it necessary to run “rails freeze_gems ”
for simple hellow world application..

Got something to say?

About

Paul is a web developer for Kyanmedia web agency. He's lucky enough to write in Ruby on Rails full-time and uses this site to post snippets of code.

Contact

my name at gmail.com

More snippets

Take a look in the archive

Need a website?

Contact my employer. Make sure to check out our portfolio of work.

Hosting

I recommend hostingrails.com