in Quid Pro Quo, Rails

Arghhhhh! The path to ruby lib is wrong!

nanoRAILS was down for the past 12h because of a setup change on my host on DreamHost.

Suddenly, the link /usr/local/lib/ruby was changed to point to an incorrect location, so instead of having the ruby libraries under /usr/local/lib/ruby/1.8, they would effectively be under /usr/local/lib/ruby/ruby/1.8 :(

Suffice it to say that things don’t work too well after that.

Running dispatch.fgci by hand revealed that “require pathname” fails. Hmmm, that’s not supposed to happen! That when I realized the above mentioned link had been changed just a few hours before.

After tinkering some more, and trying a few options, I managed to put a kludge together till the link is put back in the right place.

In the public directory, I created a myruby script:

#!/bin/bash
export RUBYLIB=/usr/local/lib/ruby/ruby/1.8/:/usr/local/lib/ruby/ruby/1.8/i386-linux/
/usr/bin/ruby $*

Make sure that script is executable (chmod +x myruby)

then in dispatch.fcgi, I replaced the first line with:

#!/usr/bin/env [PATH TO YOUR RAILS APP]/public/myruby

Of course, this will likely break once the link is restored to its correct value.

You’ve got to love using a shared host!

Update: ruby setup is back to normal now. At least I learned something in the process.
Everyone that was inconvenienced by this outage, please accept my apologies.