More Rails on DreamHost Pain

I thought I sorted out my problems with my sites needing Rails 1.0 by configuring them to use specific versions of the required gems. But this was short lived, the other day my sites just stopped working. I reported the problem to DreamHost and after a couple days they told me I was trying to use a version of a gem that wasn’t available. The various gems and the versions needed are:

rails 1.0.0 1.1.0
activerecord 1.13.2 1.14.0
actionpack 1.11.2 1.12.0
actionmailer 1.1.5 1.2.0
activesupport 1.2.5 1.3.0
actionwebservice 1.0.0 1.1.0

I had setup my environment.rb file to lock the gems to the versions needed for Rails 1.0.0, this got around the problems with the Rails 1.1 upgrade. So what went wrong? DreamHost uninstalled activerecord 1.13.2, 1.14.0 doesn’t work with Rails 1.0. “Aha!” I hear a lot of you say, “you should have run rake freezegems“, which is in fact what I did to get everything working again, but I do have an issue with it. By running freezegems you’re copying the libraries into your application, so for each app you need a complete copy of Rails. That’s a pretty old school way of doing things, we’ve had shared libraries for a long time now.

But space is not my major concern, my first one is minor bug fixes. If there’s a bug, or more likely a security issue, there should be a compatible version of the library released with the fix. This minor upgrade should continue working with my application without me doing anything, if you copy the library into your app you don’t get this benefit. The other issue is that by copying Rails into your application it doesn’t matter if your host has Rails installed since you’re using your own copy. All those gems that DreamHost installs? Absolutely useless. I install them on my laptop, do a rake freezegems and copy the whole lot over. On a related note by uninstalling activerecord 1.13.2 I couldn’t have done freezegems on the host, I had to do it locally.

This is such an unsustainable (I could say ‘doesn’t scale’ but I know how bothered people get with that phrase ;) ) way of managing libraries. Sure it’s fine for my two applications, but what happens if you have ten, or a hundred? Each time a new version of a gem is released you need to go to each one of them and do a ‘rake freeze_gems’. If your host doesn’t install the complete set of versions you need, then you need to do it somewhere else and copy everything over, madness!

Spread the word: Technorati related  |  Technorati related  |  del.icio.us bookmark it!  |  submit More Rails on DreamHost Pain digg.com digg it!  |  reddit reddit!

Leave a Reply

Line and paragraph breaks automatic.
XHTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>