2

I am installing rmagick in mac system, I have installed imagemagick version 7 by using the command brew install imagemagick , now I am executing gem install rmagick but I am getting the below error.

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

I have added export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH" in my bashfile but no luck

Chakreshwar Sharma
  • 2,571
  • 1
  • 11
  • 35
  • Possible duplicate of [Can't install RMagick 2.13.1. Can't find MagickWand.h.](http://stackoverflow.com/questions/9050419/cant-install-rmagick-2-13-1-cant-find-magickwand-h) – Slava.K Feb 02 '17 at 08:50
  • I added export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH" in my bash_profile as per the above link , but no luck – Chakreshwar Sharma Feb 02 '17 at 08:53
  • Have you tried other solutions from other answers in that question? There are a few more – Slava.K Feb 02 '17 at 09:15

2 Answers2

1

Finally , I downgraded the version of imagemagick to make it working i.e.

brew uninstall imagemagick
brew uninstal imagemagick@6

Then, set the path for MagicWand & MagicCore.h

export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick\@6/6.9.7-6/lib/pkgconfig/
Chakreshwar Sharma
  • 2,571
  • 1
  • 11
  • 35
0

Try uninstalling ImageMagick and re-installing with the --build-from-source option and that will get you the header you seek:

brew rm imagemagick
brew install imagemagick --build-from-source <ANY OTHER OPTIONS>

Now check you have it:

find /usr -name "MagickWand.h"
/usr/local/Cellar/imagemagick/7.0.4-6/include/ImageMagick-7/MagickWand/MagickWand.h
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432