RMagick Installing RMagick on OS X using MacPorts

Revised 16Nov2007

This page describes a method for installing RMagick, ImageMagick, and the delegate libraries used by ImageMagick. I developed this procedure using a clean install of OS X 10.5 (Leopard) on a PowerPC PowerBook G4, but the procedure should be the same for Tiger and Intel Macs.

You will need to have your OS X installation disk, a connection to the Internet, and at least an hour of free time (assuming you have a broadband connection). You should also be familiar with the bash shell and the Terminal application.

Step 1: Install MacPorts

Go to the Installing MacPorts web page and follow the instructions there to install MacPorts. Note that you must install the XCode Tools, X11.app, and the X11 SDK.

The remainder of these instructions assume that you installed MacPorts using all the defaults.

Step 2: Install ImageMagick and its delegate libraries

If you have not already done so, start the Terminal application.

Enter this command in a Terminal window.

sudo port install tiff -macosx imagemagick +q8 +gs +wmf

You'll be prompted for your password. Be patient. Depending on your Internet access speed and the speed of your CPU this could take an hour or more.

This command installs support for JPEG, TIFF, WMF, PDF, and PNG images, and for Postscript and TrueType fonts.

Step 3: Install RMagick

Enter this command in a Terminal window.

sudo gem install rmagick

Again, you'll be prompted for your password. You'll see this output:

Bulk updating Gem source index for: http://gems.rubyforge.org
Building native extensions.  This could take a while...
Successfully installed rmagick-X.Y.Z

Be patient. A lot of time will pass with no output from the gem command. The "Successfully installed" message does not mean that RMagick was successfully installed. The RMagick installation can encounter error conditions that gem can't detect. The following irb session is a better indicator of a successful install. (Of course the version numbers in the message may vary from what is shown here, depending on what versions of the software are currently available.)

$ irb -rubygems -r RMagick
irb(main):001:0> puts Magick::Long_version
This is RMagick 1.15.3 ($Date: 2007/01/20 15:45:29 $) Copyright (C) 2007 by Timothy P. Hunter
Built with ImageMagick 6.3.2 02/23/07 Q8 http://www.imagemagick.org
Built for ruby 1.8.5 (2006-12-25 patchlevel 12) [powerpc-darwin8.0.0]
Web page: http://rmagick.rubyforge.org
Email: rmagick@rubyforge.org
=> nil

If you're using the version of Ruby that comes with Leopard, the RMagick HTML documentation is automatically installed at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/share/RMagick/index.html. If you're using your own installation of Ruby, the RMagick HTML documentation is automatically installed at $PREFIX/share/RMagick/index.html.

That's it. You should have a complete install of ImageMagick and RMagick.

Back to the FAQ.

Thanks to my correspondents Rob Dupuis and Frederick Möllerstrand, to Ryan Schmidt for the ImageMagick port, and to the good folks at NullStyle.