Installing RMagick on Ubuntu

Updated . Posted . Visible to the public.

When installing RMagick Show archive.org snapshot you may get an error messages like this:

Version 2.13.1:

checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in /home/arne/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/lib/gems/1.8/bin

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Version 2.16.0:

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
	ERROR: Failed to build gem native extension.

        /home/user/.rbenv/versions/1.8.7-p375/bin/ruby extconf.rb
checking for /usr/bin/gcc... yes
checking for Magick-config... yes
checking for outdated ImageMagick version (<= 6.4.9)... no
checking for presence of MagickWand API (ImageMagick version >= 6.9.0)... no
extconf.rb:84: command not found: MagickWand-config --cflags
extconf.rb:84: command not found: MagickWand-config --cppflags
extconf.rb:84: command not found: MagickWand-config --ldflags
extconf.rb:84: command not found: MagickWand-config --libs
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.16.0. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Solutions

Make sure you have the necessary development packages installed.

sudo apt-get install libmagickcore-dev libmagickwand-dev

You might not require libmagickwand-dev for some older versions of RMagick. On previous Ubuntus you may need to install libmagick9-dev Show archive.org snapshot instead.

Ubuntu 10.10

After installing the development packages this command should work:

gem install rmagick -v '2.13.1'

or upgrade rmagick.

Ubuntu 18.04

ls -la /usr/lib/x86_64-linux-gnu/ImageMagick-6.9.7/bin-q16/
PATH="/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.7/bin-q16/:$PATH" gem install rmagick -v '2.13.1'

or upgrade rmagick.

Arne Hartherz
Last edit
Emanuel
Keywords
debian, image-magick
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2011-04-05 09:33)