Installing RMagic for Ruby on Rails on OSX Tiger

Installing RMagic for Ruby on OSX can be a little tricky especially considering running 'gem install RMagic' usually results in a bunch of error messages. There is a couple of ways to get this installed without too much fuss. One way is to follow the how-to on the RMagic site.

This how-to is a little long and requires installation of many Darwin ports. Fortunately however there is a self contained installer for OSX available called Locomotive. It bundles Ruby, Rails, RMagic and a bunch of other tools into an easy installer.

If you are like me and like the ability to track and update your packages you may prefer using Fink.

After installing Fink (and probably FinkCommander) compile and install imagemagick-nox and imagemagick-nox-dev plus all their dependencies from source (to get the latest versions). Choosing the -nox packages gets around a few RMagic compile errors related to X image functions tied into Xorg.

Once imagemagick-nox is compiled and installed download the source tar for RMagick.
Uncompress the source to a location, change into that directory and run:

LDFLAGS=-L/sw/lib ./configure (enter)
[where /sw/lib is the path to your fink library directory]
make (enter)
make install (enter)

If everything goes to plan you should have a working Ruby/RMagic implementation ready to use in your Rails' applications.