Installing ImageMagick & RMagick on OS X 10.6 Snow Leopard

This marks hour 4 of setting up ImageMagick & RMagick on my MacBook Pro – without MacPorts (MacPorts and I had a falling out years ago).

In an effort to save all of us that time, here’s how I got ImageMagick and RMagick working on my MacBook Pro running 10.6.2 Snow Leopard

  1. Download and unpack masterkain’s install script from github: http://github.com/masterkain/ImageMagick-sl.
  2. open up a terminal, cd into the install script’s directory.
  3. run ./install_im.sh .
  4. Let it run. Note – you will need to provide your admin password a couple times.
  5. Give the kids a bath.
  6. Download and unpack RMagick (I couldn’t get the gem to work)
  7. cd into the resulting RMagick directory and run ruby setup.rb config --disable-htmldoc
  8. then, provided no errors are thrown run sudo ruby setup.rb install

Update:
ImageMagick didn’t correctly guess the location of the Ghostscript fonts and threw the following error in my log when it ran

Magick::ImageMagickError (unable to read font `/usr/local/lib/ImageMagick-6.5.8/config//usr/local/share/ghostscript/n019003l.pfb' @ annotate.c/RenderFreetype/1043: `(null)'):

To fix this, navigate to ImageMagick’s config directory in the terminal, cd /usr/local/lib/ImageMagick-6.5.8/config then open up configure.xml in your favorite text editor. Then look for --with-gs-font-dir= and set it to the correct path (in my case I just appended /fonts to the path).

6 thoughts on “Installing ImageMagick & RMagick on OS X 10.6 Snow Leopard

  1. scott

    i had the same issue pop up in a rails project using the rmagick-2.13.1 gem.

    the fix didn’t work for me. so, i gave up and installed macports (:, and then
    used that to re-install image magick. still no joy.

    i then re-installed the rmagick gem. which did work. which makes sense. the gem is built natively, and might to need to link something.

    my thought is that the fix *probably* would have worked for me. i just had to re-install the gem.

    many thanks, for the post.

  2. maxkaplan

    I am having the same issue and nothing will fix it.

    I’m running 10.6

    I installed RMagick-2.13.1 via source as described.

    But I still get ..

    install RMagick2.bundle /usr/local/lib/ruby/site_ruby/1.8/i686-darwin9.6.2/.

    then i get..

    => Rails 2.3.5 application starting on http://0.0.0.0:3000
    /usr/local/lib/ruby/site_ruby/1.8/i686-darwin9.6.2/RMagick2.bundle: dlopen(/usr/local/lib/ruby/site_ruby/1.8/i686-darwin9.6.2/RMagick2.bundle, 9): no suitable image found. Did find: (LoadError)
    /usr/local/lib/ruby/site_ruby/1.8/i686-darwin9.6.2/RMagick2.bundle: mach-o, but wrong architecture – /usr/local/lib/ruby/site_ruby/1.8/i686-darwin9.6.2/RMagick2.bundle

    Please help

  3. John

    This was great. The only minor hiccup I had was that it couldn’t find one of the packages it had to download, but that was easily solved by checking the FTP server it was pulling the file from and changing the URL in the script to reflect what the server actually had on hand (libpng 1.4.7 instead of libpng 1.4.5 or something). Everything else went without a hitch and I was up and running in no time. Thanks a lot!

Comments are closed.