10
votes

Tried installing rmagick in Mountain Lion with sudo gem install rmagick and got the following. Any help is appreciated. None of the forum answers worked.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for xcrun... 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... yes
checking for InitializeMagick() in -lMagickCore... no
checking for InitializeMagick() in -lMagick... no
checking for InitializeMagick() in -lMagick++... no
Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.
4
Have you installed imagemagick first? - Frederick Cheung
Yes, probably imagemagick is not installed. I suggest using homebrew to install imagemagick on mac. - Alper Karapınar

4 Answers

20
votes

This worked for me...

As stated on earlier answers:

$ brew remove imagemagick
$ brew install imagemagick --disable-openmp --build-from-source

I got the magicwand.sh :

$ mdfind MagickWand.h -->
/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/wand/MagickWand.h

I then took out the whole path except the actual filename and added C_INCLUDE_PATH= eg:

/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/wand/
--->
C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/

I then looked for MagickCore.pc

$ mdfind MagickCore.pc
/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/MagickCore.pc

The same for this as before:

/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/
--->
PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/

I then used these two paths with gem install:

$ sudo C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/ PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/ gem install rmagick

And it finally worked after hours of research. Hope it helps someone.

17
votes

Reinstall imagemagick with Homebrew:

brew remove imagemagick
brew install imagemagick --disable-openmp --build-from-source

Or you can install using this shell script::

https://github.com/maddox/magick-installer
7
votes

I've been struggling with this Rmagick on Mountain Lion installation issue for a while, and tried MANY different solutions, and this is the one that finally did the trick for me :

Reinstall imagemagick with Homebrew:

$ brew remove imagemagick
$ brew install imagemagick --disable-openmp --build-from-source

and then

$ gem install rmagick -v '2.13.2'

Thank you to Andrew Nesbitt and Phillipe Gustavo for posting and editing this solution !

1
votes

The following solved it for me:

brew remove imagemagick
brew install imagemagick --disable-openmp --build-from-source

cd /usr/local/Cellar/imagemagick/6.8.8-9/lib
ln -s libMagick++-6.Q16.3.dylib libMagick++.dylib
ln -s libMagickCore-6.Q16.2.dylib libMagickCore.dylib
ln -s libMagickWand-6.Q16.2.dylib libMagickWand.dylib

gem install rmagick  -v '2.12.2'

source: http://winstonyw.com/2013/03/21/installing-imagemagick-and-rmagick/