How to freeze old rails gems

You probably came here wondering why

rake rails:freeze:edge RELEASE=2.3.2

doesn’t work, right? (It times out trying to pull the rails gem from http://dev.rubyonrails.org/archives/rails_2.3.2.zip)

Now you could try to hack the rake task in your rails gem

OR

- you could just go to rails github page https://github.com/rails/rails
- click on the ‘switch tags’ button  and select the version of rails you’re looking for
- after the page reloads, click on download and select the ‘zip’ version
- download it to your ‘vendor’ directory in the rails app you’re trying to freeze rails to
- unzip the file and rename the directory to rails
- you’re done!

To make sure you’re running a vendored copy of rails you can just  put

<%= debug Rails.vendor_rails? %>

somewhere in one of your views, or run

Rails.vendor_rails?

from the console.
enjoy.