Rails - Can't install RMagick 2.16.0. Can't find MagickWand.h

I have had the same issue for about a month, Mark (ever since the Imagemagick 7 update). I'm using homebrew on OSX Sierra.

For future visitors to this question, you can try linking and unlinking pkgconfig (brew unlink pkgconfig && brew link pkgconfig) or specifying the path as Mayur describes, but if those don't work you'll need to install Imagemagick 6 from source as Mark has done:

$ brew uninstall imagemagick
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/6f014f2b7f1f9e618fd5c0ae9c93befea671f8be/Formula/imagemagick.rb

I believe the issue ultimately lies with pkgconfig, so when you see an update to pkgconfig, that should be the tipoff to try again.


Worked this one for me at osx sierra

brew unlink imagemagick
brew install imagemagick@6 && brew link imagemagick@6 --force
echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile

Got it here RMagick installation: Can't find MagickWand.h


Imagemagick 7 seems to not cooperate. Here is what I have found, it works for me:

brew update
brew rm imagemagick
brew install imagemagick@6
brew link imagemagick@6 --force
bundle

If you do not want to force link you can also do the following:

brew install imagemagick@6
PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick

per @Leo's comment

Please look at this GitHub Issue for more details.