rmagick/rmagick — Issue #39: ImageMagic installed via Homebrew doesn't work
Author: jkamenik
Created: 2011-12-01 18:55:42+00:00
State: open

I use a Mac, and homebrew for many packages including ImageMagick. I noticed a very annoying issue that I had to work around. Homebrew symlinks to `/usr/local/bin` and `/usr/local/include`. For example: `/usr/local/include/ImageMagick -> /usr/local/homebrew/.../ImageMagick`. This works fine with most libraries that need imagemagick since Magick-config produces the correct paths to the symlinks and the compilers just follow the sym links.

The rmagic gem compile does not seem capible of following symlinks and therefore cannot find `/usr/local/include/wand/MagickWand.h` which is there.

``` sh
$ gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

/Users/jkamenik/.rvm/rubies/ruby-1.8.7-p352/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/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... no

Can't install RMagick 2.13.1. 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=/Users/jkamenik/.rvm/rubies/ruby-1.8.7-p352/bin/ruby
```

My solution was to install ImageMagick via https://github.com/maddox/magick-installer/blob/master/magick-installer.sh, which doesn't use symlinks. Without symlinks things work fine.