We upgraded our CrossConnector server software this week, including Rails 1.1 and the latest versions of Ruby and Lighttpd. What should have been a simple upgrade turned into a two-day stress-fest, as we tried to figure out why a couple of our applications just wouldn’t work.

I finally traced the problem to RMagick – Ruby’s ImageMagick interface. Our program uses file_column and Sparklines, which both depend on RMagick. We had elected to upgrade to the latest version of RMagick using “gem upgrade”, and everything worked perfectly, or seemed to. But our apps just wouldn’t load.

The heart of the problem turned out to be that our app was loading RMagick, which in turn was looking for a file called ‘RMagick.so’, which was nowhere on our system. The file was present on our development server, and the app was running flawlessly in development, so I figured that the program was legit and that somehow the file had just been forgotten during installation. I was right. The hard part was figuring out how to get it there. I tried reinstalling RMagic from the gem, downgrading to a previous version, and even copying the RMagick.so file by hand. Nothing. Finally I decided to try compiling RMagick from source. And… Success! Here’s what I did…

sudo gem uninstall RMagick (remove all versions)
cd /usr/local/src (where I keep my source files)
curl -O http://rubyforge.halostatue.info/rmagick/RMagick-1.10.1.tar.gz
tar xzvf RMag