Installing rmagick

by balint

I needed to install rmagick for a Rails project. I had some amount of trouble along the way but finally succeeded so I am sharing my experience in case you bump into the same problems.

I first installed the binary OS-X distribution of imagemagick (no problems here) and then attempted to install rmagick, the ruby interface to the ImageMagick libraries:

sudo gem install rmagick

However, I received the following unpleasant error:

Can't install RMagick 2.7.2. Can't find MagickCore.h.

I checked that the header file is there (on the path the install script was looking for it), and decided not to go the hard way. After some googling I found there is a rmagick-osx-installer which downloads, compiles and installs ImageMagick and rmagick. Just what I needed.

However, the script failed to accomplish its mission, it hung when installing rmagick. Taking a peak in its log I saw several other errors so I had to look for another way. And that way was compiling the ImageMagick library myself. So I downloaded the source, made the configuration-make-make install cycle and fortunately everything went smoothly. The good news is I could install rmagick without any problem after that:

balint$ sudo gem install rmagick
Building native extensions.  This could take a while...
Successfully installed rmagick-2.7.2
1 gem installed

Rss Comments

2 Comments

  1. Hey Balint, installing rmagick was one of my worries as a recent mac switcher. But at the end it was quite easy: I installed ImageMagick through macports, and rmagick as a gem.

    You also can install rb-magick through macports but it’s not a good idea, as it will try to install ruby 1.8.7 as well.

    #1 Jaime Iniesta
  2. Yes, that’s a possibility. I somehow like to set aside macports and compile most things or install a universary binary. It is just a habit, though.

    #2 balint

Leave a comment