I think the current version of stable Rails is 1.2.3. For those of you using this version, rather than Edge Rails, there’s a little gotcha in the rake tasks.
Since I’m on a shared host, it’s good practice to freeze your version of rails into the vendor’s directory. You do this by using a rake task, per “rake rails:freeze:gems” But before you do that, if you’re using SVN, you’ll want to use “svn delete” to remove the vendors/rails directory. None of the rake tasks use SVN delete. They all use “rm -rf”, which in my experience makes SVN freak out if the .svn directory is gone.
However, even with that done, freezing a new version of gems was failing.
It was looking for rails version 1.4.0, and not being able to install it. And even worse, when you try to run rake again, it said it couldn’t find it!
Well, the latter was simple. A failed freeze leaves a blank vendor/rails directory, and if you look in ‘config/boot.rb’, it says:
...blah blah blah..
So make sure you remove vendor/rails.
The latter took a little bit of work digging around the rake tasks, and though it wasn’t hard, I wasted about an hour. It ends up that the culprit is that the default rake task uses Gem.cache.search(‘rails’), which returns all gems with the name ‘rails’ in it.
I have a couple gems installed with the word ‘rails’ in it.
rails (1.2.3, 1.2.0, 1.1.6)
So it took the latest one, which was 1.4.0, and tried to install rails 1.4.0, which doesn’t exist!
To hot fix it, the railities/lib/tasks/framework.rake file, under the freeze namespace and gems task, change “Gem.cache.search” to “Gem.cache.find_name”
That way, it only finds ‘rails’, and not all the other games with ‘rails’ in the name of the gem. This problem is solved in edge Rails, so no need to submit a patch. Tip!