Rmagick

To write a rails app that manipulates images (e.g. makes thumbnails), you need the extension rmagick. Rmagick is hard to install, as its web page notes:

RMagick can be more difficult to install than the typical Ruby extension. First you have to install ImageMagick or GraphicsMagick, and those libraries require a lot of other libraries.

I wanted to install it on my Mac without depending on Fink or MacPorts so it wouldn’t be vulnerable to my wiping out Fink or MacPorts in a fit of anger and resentment.

In retrospect, I could have installed it without immense pain by consulting the aforementioned web page. Also, I ran into trouble compiling libwmf, which was related to the ‘gd‘ graphics library, so I decided to try installing gd on its own first; it turns out gd has a great document about solving problems that arise compiling on OS X, and many of the tricks there help with other prerequisites.

Finally I had to make my own little fix by going to /usr/local/share/ghostscript and doing the following:

sudo ln -s 8.56/fonts ./
sudo ln -s 8.56/lib ./
sudo ln -s 8.56/Resource ./

because rmagick was looking for fonts in /usr/local/share/ghostscript, not /usr/local/share/ghostscript/8.56. (The lib and resource links may not have been necessary but I did them to be thorough.)

After only a half dozen lengthy false starts and staying up till 1 AM messing with it, I had me a working copy of Rmagick! Huzzah for libraries that depend on libraries that depend on libraries that depend on libraries, where a problem compiling any one of them can hose you completely!