ImageMagick 7 with RMagick 2.16 on MacOS Sierra Can't find MagickWand.h
Solution 1
I have just encountered and solved this issue on a new Mac running Sierra. There seems to be no solution for ImageMagick 7 at this time.
Uninstall existing imagemagick if needed
Install version 6:
brew install imagemagick@6
Since this is keg-only, you should then force-link it:
brew link --force imagemagick@6
This installed imagemagick version 6.9.7-4 for me.
Afterwards, the gem then installed successfully. I am including the version numbers for future readers:
Installing rmagick 2.13.4 with native extensions
Solution 2
dyson's solution didn't quite work for me. I found that in addition to installing imagemagick@6
, I also need to install pkg-config and then set PKG_CONFIG_PATH
.
brew install imagemagick@6 pkg-config
PATH="/usr/local/opt/imagemagick@6/bin:$PATH" PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick -v '2.13.4'
florigee
ruby on rails lover, interested in ember, fancy stuff and my awesome wife. Running my own company in augsburg, bavaria.
Updated on June 02, 2022Comments
-
florigee almost 2 years
I upgraded to imagemagick-7.0.4-3.sierra and now my previously installed RMagck 2.16 fails. I checked for MagicWand:
$ find /usr/local -name MagickWand.h /usr/local/Cellar/imagemagick/7.0.4-3/include/ImageMagick-7/MagickWand/MagickWand.h
So it seems to be there. Also I reinstalled and relinked pgk-config. Didn't help as well. Any ideas?
-
mmln over 7 yearsI didnt find a solution for making rmagick to work with imagemagick v7, falling back to v6 works as described in this answer, thanks
-
maxhm10 over 7 yearsYou saved me so much frustration. Thank you!!
-
Brian about 7 yearsI found this 2 hours in. I want to throw my computer out a window.
-
Daniel about 7 yearsI opened an issue: github.com/rmagick/rmagick/issues/265 Let's see if they add this to the documentation.
-
dyson returns about 7 yearsThanks @Daniel. You're a champ.
-
Yunwei.W almost 7 yearshad to run
echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile
after the above steps. hope it helps others. -
dyson returns almost 7 years@Yunwei.W Are you sure you uninstalled other versions of imagemagick and that you definitely force-linked it?
-
utahtwo almost 7 yearsThank you! Worked great on Sierra
-
caleb531 over 6 yearsIf you'd prefer not to load all of ImageMagick's binaries onto your PATH, you can also run
export PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig
-
Peter H. Boling about 6 yearsI needed both --force AND --overwrite:
brew link --force --overwrite imagemagick@6
Otherwise this worked! -
Valdis over 5 yearsI prefer this solution because I don't have to remove the global linking to the latest ImageMagick version.
-
Rafał Cieślak about 5 years@TheLazyLog I think the problem with other solutions is that they assume you have stuff like pkg-config installed – after some time of using homebrew, one will definitely wind up with pkg-config on their computer. I was setting up a fresh Mac so that assumption just wasn't true for me.