Problem installing "rmagick" gem

I had a problem installing the "rmagick" gem on centos. The following is the conclusion that I have. Can someone help me determine which package I am missing ? I installed all the other threads mentioned: RMagick installation error

Building native extensions. This could take a while... ERROR: Error installing rmagick: 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 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 Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2 for inspection. Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out 

After the following sentences, I now get this conclusion:

 Building native extensions. This could take a while... ERROR: Error installing rmagick: 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 checking for ImageMagick version >= 6.4.9... yes checking for HDRI disabled version of ImageMagick... yes checking for stdint.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 /usr/local/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/local/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' from /usr/local/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header' from /usr/local/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' from /usr/local/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' from /usr/local/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /usr/local/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' from /usr/local/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /usr/local/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' from /usr/local/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' from /usr/local/lib/ruby/1.9.1/mkmf.rb:930:in `have_header' from extconf.rb:194:in `<main>' Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2 for inspection. Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out 

Output file mkmf.log:

 checking for HDRI disabled version of ImageMagick... -------------------- yes -------------------- "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6 conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -lMagickCore-6.Q16 -L/usr/lib -lMagickCore-6.Q16 -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpthread -lrt -ldl -lcrypt -lm -lc" /usr/bin/ld: skipping incompatible /usr/lib/libMagickCore-6.Q16.so when searching for -lMagickCore-6.Q16 /usr/bin/ld: skipping incompatible /usr/lib/libMagickCore-6.Q16.so when searching for -lMagickCore-6.Q16 /usr/bin/ld: skipping incompatible /usr/lib/libMagickCore-6.Q16.so when searching for -lMagickCore-6.Q16 /usr/bin/ld: cannot find -lMagickCore-6.Q16 collect2: ld returned 1 exit status checked program was: /* begin */ 1: #include "ruby.h" 

The output of gem_make.out is similar to the output of the terminal.

+56
ruby gem
May 27 '13 at 13:39
source share
7 answers

try to install

  sudo apt-get install libmagickwand-dev imagemagick 
+114
May 27 '13 at 14:33
source share
β€” -

This ImageMagick 7 with RMagick 2.16 on MacOS Sierra Cannot find MagickWand.h works for Rmagick 2.16.

 brew install imagemagick@6 brew link --force imagemagick@6 gem install rmagick 
+16
Mar 21 '17 at 19:25
source share

The error message says:

 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 

It seems that you are missing a package at all, you just need to tell pkg-config where to find the MagickCore.pc file to build the extension. If you installed the ImageMagick-devel package using yum , the file must be inside the /usr/lib/pkgconfig or /usr/lib64/pkgconfig (depending on your architecture). Check this command (now I assume that you are on an amd64 machine, if it is not, replace lib64 with lib ):

 $ find /usr/lib64/pkgconfig -name MagickCore.pc 

If there is a file, you just need to install rmagick with this command:

 $ PKG_CONFIG_PATH='/usr/lib64/pkgconfig' gem install rmagick 
+13
May 27 '13 at 14:29
source share

For Mac with Brew just ..

brew install imagemagick

Then gem install imagemagick will work smoothly.

+7
May 25 '16 at 23:29
source share

It doesn't seem like you are missing any packages. The error message is important:

Perhaps you should add the directory containing `MagickCore.pc 'to the PKG_CONFIG_PATH environment variable

A few answers to a duplicate of this superuser give good advice.

+3
May 27 '13 at 14:31
source share

In debian (erratic), the correct packages needed to fix this error were libmagickcore-6.q16-dev , imagemagick and libmagickwand-6-headers

I found them using apt-file search MagickCore.pc and apt-file search MagickWand.h

+1
May 11 '16 at 21:19
source share

The problem is that, as the error indicates,

MagickCore package not found in pkg-config search path

A solution is also offered there:

add the directory containing MagickCore.pc to the PKG_CONFIG_PATH environment PKG_CONFIG_PATH

So,

  • Find the location of MagickCore.pc:

     sudo find / -name MagickCore.pc 
  • If it is not found, it is possible that ImageMagick is not installed on your system - then install it (Google how to do this, since it depends on the OS)

  • Save it in ENV var like this (do not forget to specify the path found in step 1):

     PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/MagickCore.pc 
  • Retry RMagick

+1
Aug 08 '16 at 7:53 on
source share



All Articles