HostOnNet Blog

Can’t install RMagick 2.13.2. Can’t find MagickWand.h.

Looking for Linux Server Admin or WordPress Expert? We can help.

When installing rmagick gem, i got following error


Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes

Warning: Found a partial ImageMagick installation. Your operating system likely has some built-in ImageMagick libraries but not all of ImageMagick. This will most likely cause problems at both compile and runtime.
Found partial installation at: /usr/local
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.2. 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.1.0/gems/rmagick-2.13.2 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/rmagick-2.13.2/gem_make.out
An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.
[root@lin redmine]#

Searched for file MagickWand.h


[root@lin redmine]# find /usr -name MagickWand.h
/usr/local/src/ImageMagick-6.8.8-7/wand/MagickWand.h
/usr/local/include/ImageMagick-6/wand/MagickWand.h
[root@lin redmine]#

Problem is fixed by running

C_INCLUDE_PATH=/usr/local/include/ImageMagick-6 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ gem install rmagick -v '2.13.2'


[root@lin pkgconfig]# C_INCLUDE_PATH=/usr/local/include/ImageMagick-6 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ gem install rmagick -v '2.13.2'
Building native extensions. This could take a while...
Successfully installed rmagick-2.13.2
Parsing documentation for rmagick-2.13.2
Installing ri documentation for rmagick-2.13.2
Done installing documentation for rmagick after 7 seconds
1 gem installed
[root@lin pkgconfig]#

Posted in Ruby On Rails

One Response to Can’t install RMagick 2.13.2. Can’t find MagickWand.h.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.