Installing CentOS 5, ImageMagick, and RMagick
I don‘t normally blog about obscure, specific technical topics, mainly because 99% of the time I find a blog entry someplace that has already covered it. This is an exception, as the amount of information out there on this topic is confusing and dated.
Installing ImageMagick and RMagick on CentOS5 seems to be a bit of a dark art, mainly because of the amount of stale information and differences between linux distributions. This entry will eventually be stale as well, so check the date and version numbers – your mileage may vary.
The ImageMagick/RMagick combination is arguably one of the coolest yet painful combination of ruby/native code out there. There are a lot of attempts to replace, simplify or otherwise solve this pain, but today, rmagic is often a necessary tool in the rubyist‘s toolbox. So here‘s my attempt to lessen that pain.
I‘ll include details and explanations with each command line. I have you as a captive audience, and the details will give this post more relevance if the version numbers have moved on since this writing. There are only 3 commands, so bear with me.
One more caveat – I‘m taking the short path using the most recent CentOS5 packaged versions. If you need the latest version of ImageMagick, have fun compiling it all yourself. There are plenty of sites out there with direction. For me, one of the reasons I‘m using CentOS5 (with this client) is for the stability and ease of package management.
1) First we install ImageMagick as an rpm using yum. As of this install, the latest CentOS package is 6.2.8.0–4.el5_1.1. This is lagging considerably from the newest version, and that causes some of our issues.
yum install ImageMagick
This will ask to download and install all kinds of stuff (43 other packages on a stock CentOS server install). Let it install whatever it wants. If the version number of ImageMagick is up to the 6.3.x range by the time you read this, then this post probably isn‘t want you‘re looking for. (although exaplanations below will still help you).
2) Now install the ImageMagick-devel library. Yes, that could have been done in the same step above, I‘m just trying to be explicit for your benefit.
yum install ImageMagick-devel
That wants to install 16 packages on my stock CentOS5 server.
So no surprises so far. It is the ruby gem that causes us all the problems…
3) Install the RMagick gem. I‘m about to make this look easy, but it wasn‘t. The first problem is that the latest RMagick gem needs the 6.3.x series of ImageMagick, which isn‘t packaged for CentOS5 yet. So I had to determine the latest version of the RMagick gem that works on the 6.2.x series. As of this writing, that is 1.15.13, and you can find that out at the RMagick gem page
But installing that just might fail in a blaze of glory that only a software engineer with a minor in forensic investigation would enjoy. Near as I can tell, the install of the gem would succeed if it weren‘t for some failures building the documentation. These failures vary from machine to machine, as it seems to depend on what fonts you have installed (which might depend on what version of OpenOffice, etc). Solution? We dont need no stinkin‘ docs!
gem install rmagick –v 1.15.13 ––no–rdoc ––no–ri
a minute later, I get the output:
Successfully installed rmagick-1.15.13
By the way, I‘m not writing this from memory. I just took a CentOS 5 VMWare image and wrote this as I upgraded it. Commands above are copied from the command-line. These steps also work on the CentOS5 EC2 Amazon Machine Image from RightScale.

