Stolen from: ZenSpider: http://blog.zenspider.com/archives/2006/08/upgrade_rails_n.html
If you prefer to freeze your rails checkout. I recommend stealing this rule:
1
2 namespace :rails do
3 namespace :freeze do
4 desc "Lock to a specific rails version. Defaults to 1.1.5 or specify with RELEASE=x.y.z"
5 task :version do
6 rel = ENV['RELEASE'] || '1.1.5'
7 tag = 'rel_' + rel.split(/[.-]/).join('-')
8 rails_svn = "http://dev.rubyonrails.org/svn/rails/tags/#{tag}"
9
10 puts "Freezing to #{tag} using #{rails_svn}"
11 sh "type svn"
12
13 dir = 'vendor/rails'
14 rm_rf dir
15 mkdir_p dir
16 for framework in %w( railties actionpack activerecord actionmailer activesupport actionwebservice )
17 checkout = "#{dir}/#{framework}"
18 sh "svn export #{rails_svn}/#{framework} #{checkout}"
19 unless test ?d, checkout then
20 puts "ERROR: checkout missing: #{checkout}"
21 exit 1
22 end
23 end
24 end
25 end
26 end
and running:
1
2 rake rails:freeze:version
It'll default to 1.1.5 or you can specify the tagged version you want using RELEASE=x.y.z.