RMagick on Mac OS X made simple

Howdy, in a attempt to present more material in this site, I’ll be inviting some friends to talk a bit about technology, music, lifestyle, programming and some somewhat geek topics. Hope you enjoy. To start, here’s some info on RMagick (again) by Rui Leitão.

- Pedro Sousa

Recently I found myself needing to install the infamous RMagick extension on several computers, some were running on Mac OS X Tiger, others on Leopard. The thing about the RMagick installation is simply that it requires A LOT of other libraries. Well, to be honest, it just requires ImageMagick or GraphicsMagick. It’s these fellows here who pose the real problem.

Nevertheless, there is a simple way of pulling the trick. No MacPorts needed. The most it will take you is 1 hour of your time. So, here’s the deal.

I’m assuming that the typical user will have, by the time the need to install RMagick comes, Ruby, Rails and rubygems working properly. There’s just one more thing you’ll need have installed before proceeding: The XCode Tools. (You can install it directly from your OS X installation DVD or, alternatively, it’s available for download from the Apple Developer Connection. The installation process is pretty straightforward.)

After that, we’re all ready to roll.

This process is based on a script available here. This will deliver all the libraries needed into your system. It will also give you a nice output so that you know what’s going on at any given moment.

After downloading the file, unzip it (I advise you to put it in your home directory) and run it from your console with ruby rm_install.rb . The script takes about half an hour to execute. It will download all the required libraries, install them, and get RMagick running properly on your system.

Just one final note: it happens that the script may install all the dependencies and not install the gem we really want (RMagick, that is). Here’s the final output I got:

Summary: There were 1 failures

libpng was installed successfully
libjpeg was installed successfully
ghostscript was installed successfully
ghostscript-fonts-std was installed successfully
FreeType was installed successfully
libwmf was installed successfully
ImageMagick was installed successfully
RMagick was not installed successfully
Removing rm_install_tmp directory...Done

Honestly, I didn’t bother finding out why that happened. We can see it installs every RMagick dependency, but not RMagick. But the solution is simple: just punch in sudo gem install rmagick, type in your password as it prompts you, and you’ll be on your way.

You may want to check out the complete RMagick installation FAQ here.



2 Responses (Add Your Comment)

  1. Holy moly! This is exactly what I was looking for!

    Ran like a perfect charm.
    Thanks so much.
    -Hobs

  2. Johnathan PulosNo Gravatar


    January 6, 2010
    at 7:48 pm

    Thanks for the awesome script. Before using, make sure to make the following changes:

    change line 180 to

    ‘jpegsrc’ => /(((jpegsrc)\.v7)\.tar\.gz)/,

    change line 434 to

    @delegate["jpegsrc"].version = “jpeg-7″

    The jpeg version has changed, and the old version is no longer at the Imagemagick ftp site. Thanks again.

Other Entries

About

Reinventar is the home of Pedro Sousa, an entrepreneur and developer living in Lisbon, Portugal.

I co-founded Think Orange, created Book Worms and I'm also involved in the Ruby on Rails community and in the SHiFT organization.

I usually write here about design, web, technology, lifestyle and other random ideas.

Photos

new ambient lightsnew flipchartcowork lisboa entrancehole in the wall

Interesting

PROJECTS

Think Orange Book Worms SHiFT

Recommended Reading