Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install rmagick in Mountain Lion

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.
like image 869
Muthu Avatar asked Jul 29 '12 18:07

Muthu


3 Answers

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.

like image 193
Philip Avatar answered Oct 21 '22 09:10

Philip


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
like image 17
Phillipe Gustavo Avatar answered Oct 21 '22 09:10

Phillipe Gustavo


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 !

like image 7
Mikael Theimer Avatar answered Oct 21 '22 08:10

Mikael Theimer