RMagick Gem install on Debian Lenny

I run Debian Lenny and I want to install RMagick, a Ruby interface to the ImageMagick libraries. Let’s try it (i have the ruby1.9.1 packages installed on Lenny for using Ruby 1.9.2, so many “ruby” commands have a 1.9.1 appended to them):

sudo gem1.9.1 install rmagick


Can't install RMagick 2.13.1. Can't find MagickWand.h.

Also there’s some warnings about “Found more than one ImageMagick installation.” Convential wisdom and google searching suggest that we can install that handy MagickWand.h header file dependency by installing the “libmagick9-dev” package from Lenny.  Unfortunately, if you do this and then re-install the gem, you are going to get an error that looks like:

checking for ImageMagick version >= 6.4.9... no

Ouch, so to install the MagickWand.h dependency, we had to downgrade our ImageMagick install to the point where the RMagick gem won’t even try to compile. This is the problem in how the ImageMagick Lenny packages are arranged, and I don’t quite understand the logic: “libmagic-dev” provides a more recent version of ImageMagick than “libmagic9-dev”… but only the older “libmagic9-dev” has the needed header files!

What to do? Backport a newer version of ImageMagick from Squeeze, of course! Follow these instructions for adding my Debian backports repository to your apt-sources, once you’re updated (make sure to pin anything you don’t want from my backports), do this:

sudo aptitude install libmagickwand-dev
sudo gem1.9.1 rmagick

And it compiles with the latest libmagick from Squeeze:

Successfully installed rmagick-2.13.1

3 thoughts on “RMagick Gem install on Debian Lenny

  1. iGEL

    You don’t want to install libmagic:

    apt-cache show libmagic-dev
    Description: File type determination library using "magic" numbers (development)
    This library can be used to classify files according to magic number tests. It
    implements the core functionality of the file command.
    This package contains the development files.
    Homepage: http://www.darwinsys.com/file/
    Tag: devel::lang:c, devel::library, role::devel-lib

Leave a Reply

Your email address will not be published. Required fields are marked *