Installing RMagick on Ubuntu: Problems I Encountered Doing “gem install RMagick” November 25, 2007 | 10:19 am

So, I finally got RMagick installed on Ubuntu. Here are some greatest hit error messages I got while trying to do so:
"configure: error: C compiler cannot create executables"
configure: error: Can't install RMagick. Can't find Magick-config or GraphicsMagick-config program.
in `require': no such file to load -- mkmf (LoadError)

The answer is that you need to install the following packages:

  • g++ (Yes, even if you have gcc installed)
  • imagemagick
  • libc6-dev
  • libmagick9
  • libmagick++9-dev
  • libmagic9-dev
  • ruby1.8-dev

Once that’s done, then do the gem install RMagick.

Tags: , ,

  • Brian

    I thought you were on Ubuntu? Is there a reason you didn’t use synaptic?

    Go to System (on the top menu bar), Administration, Synaptic. Search for rmagick, click to install. Which will automatically install any and all dependencies as well.

  • http://www.linkedin.com/in/robertfischer Robert Fischer

    I am using Synaptic for my system libraries and the like.

    I’d like to keep my gems — Ruby libraries — being generated through one source in order to keep life sane. So I didn’t even look to see if RMagick (the Ruby wrapper around ImageMagick) was an option.

  • lyceum

    You do not need libmagick9. apt-get did not find it, but I installed the rest on your list and rmagick loaded perfectly. Thanks for the tip!