A few days ago, my shared hosting provider ( Site5 – I do recommend them ) moved my account to a new server. Understandably, this new server had new versions of Ruby and Ruby on Rails. Sadly, my site uses Ozimodo, a (ancient) tumblelog application built for Rails 1.2.3, and I had been unknowingly depending on the global version of Rails. Naturally, my site went kerplumpf once it was moved to the new server.
After fighting with it for some time, I foolishly thought that I was able to just switch directly to Rails 2.3.8. This actually seemed to work for a moment (the main page displayed!) but everything else was still broken.
I attempted to vendor Rails (that is, have a copy of the right version of Rails inside my rails app in
vendor/rails) but I kept getting errors like this:
$ rake rails:freeze:gems (in /home/fair/pkgs/ozimodo) rake aborted! undefined method `manage_gems' for Gem:Module
After fussing about for a long while, trying to use different versions of RubyGems and all sorts of silly ideas, I went ahead and found the
rails:freeze:gems task (it’s in framework.rake) and manually completed what it is supposed to do automatically:
- Install Rails 1.2.3 if you have not already
gem unpackactionmailer (1.3.3), actionpack (1.13.3), actionwebservice (1.2.3), activerecord (1.15.3), activesupport (1.4.2), and rails (1.2.3) into `vendor/rails`
- Rename each directory without the version name (e.g., “actionmailer-1.3.3” -> “actionmailer”) except
You may also need to set
/home/yourname/ruby/gems, I can’t remember if that was necessary or not.
This was the process, as well as I can remember, which got this site back up and running again.