40

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?

2
  • 2
    I temporary fix is to downgrade to the latest imagemagick6 brew install raw.githubusercontent.com/Homebrew/homebrew-core/…
    – anny_goerl
    Jan 14, 2017 at 13:06
  • 1
    it helped me a lot, thanks! so the solution is: brew uninstall imagemagick, then brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/6f014f2b7f1f9e618fd5c0ae9c93befea671f8be/Formula/imagemagick.rb Jan 14, 2017 at 15:13

2 Answers 2

121

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.

  1. Uninstall existing imagemagick if needed

  2. Install version 6:

    brew install imagemagick@6

  3. 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

8
  • I didnt find a solution for making rmagick to work with imagemagick v7, falling back to v6 works as described in this answer, thanks
    – mmln
    Jan 20, 2017 at 21:23
  • I opened an issue: github.com/rmagick/rmagick/issues/265 Let's see if they add this to the documentation.
    – Daniel
    Feb 14, 2017 at 4:15
  • Thanks @Daniel. You're a champ. Feb 14, 2017 at 9:39
  • 2
    had to run echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile after the above steps. hope it helps others.
    – Yunwei.W
    May 2, 2017 at 6:12
  • @Yunwei.W Are you sure you uninstalled other versions of imagemagick and that you definitely force-linked it? May 2, 2017 at 14:56
7

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'
2
  • 1
    I prefer this solution because I don't have to remove the global linking to the latest ImageMagick version.
    – Valdis
    Sep 26, 2018 at 7:32
  • @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. Feb 14, 2019 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.