Error installing Rmagick on Mountain Lion

I saw other people with the same problem installing RMagick on Mountain Lion. However, none of the proposed solutions allowed me to successfully install rmagick.

Here is the error message I get:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. checking for Ruby version >= 1.8.5... yes checking for /usr/local/bin/gcc-4.2... 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... 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. *** 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. 

What I've done:

 Installed XCode Installed the command line tools Installed XQuartz Installed homebrew with imagemagick library Installed most recent version of RVM Symlinked GCC Uninstalled and reinstalled both RVM and imagemagick 

Any ideas why I still can't download rmagick?

+66
imagemagick osx-mountain-lion rvm bundler rmagick
Dec 18 '12 at 22:19
source share
8 answers

It seems the problem is with the gitub Homebrew reputation ( https://github.com/mxcl/homebrew/issues/16625 ), blaming itself for not supporting newer versions of imagemagick. For the same issue ( https://github.com/mxcl/homebrew/issues/16625#issuecomment-11519383 ) you can find this link: https://coderwall.com/p/wnomjg , which actually worked for me. This he does:

 cd /usr/local/Cellar/imagemagick/6.8.0-10/lib ln -s libMagick++-Q16.7.dylib libMagick++.dylib ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib 

Hope this helps.

+216
Dec 19 '12 at 19:57
source share
+30
Feb 04 '13 at 20:30
source share

We have done the following:

 cd /usr/local git checkout 834ce4a Library/Formula/imagemagick.rb brew install imagemagick 

This will install Imagemagick 6.7.7-6

+8
Feb 07 '13 at 22:36
source share

I know this is old, but I went through a bunch of these answers and still have not been able to get it to work. I found a random link in another language that actually solved the problem for me ( http://sugiarto.webmuapp.com/Package_MagickCore_was_not_found_in_the_pkg_config_search_path ). It looks like he was looking for PKG_CONFIG_PATH, which was not configured.

What worked for me:

 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 

Then make sure this works:

 find /usr -name 'MagickCore.pc' /usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/MagickCore.pc /usr/local/lib/pkgconfig/MagickCore.pc 

Then try installing rmagick again:

 gem install rmagick Building native extensions. This could take a while... Successfully installed rmagick-2.13.2 1 gem installed Installing ri documentation for rmagick-2.13.2... Installing RDoc documentation for rmagick-2.13.2... 

Success! Hope this helps someone else still run into this issue.

+5
Apr 01 '13 at 18:24
source share

From other answers:

 PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick gem install rmagick -v '2.13.1' 

See https://stackoverflow.com/a/3129608/ for more information on how to get these feeds.

+2
Sep 25 '13 at 22:59
source share

Here's what worked for me on macOS Sierra.

 brew uninstall pkg-config brew install pkg-config brew unlink pkg-config brew link pkg-config 
+2
Nov 24 '16 at 22:43
source share

I know this is a pretty old problem, but it happened to me recently. I am publishing this for those who have tried all the other answers and have not yet been able to solve. rmagick before version 2.13.4 worked with Ruby 1.9.3 on macOS.

Hope it helps!

+1
Feb 07 '18 at 14:28
source share

check my answer to the openssl problem https://stackoverflow.com/a/2129608/816832 - just make sure that imagemagick has been compiled, including *.pc files - by default for most programs, but not for all of it.

0
Dec 19 '12 at 18:53
source share



All Articles