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?

anny_goerl
  • 642
  • 2
  • 8
  • 13
  • 2
    I temporary fix is to downgrade to the latest imagemagick6 brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/6f014f2b7f1f9e618fd5c0ae9c93befea671f8be/Formula/imagemagick.rb – anny_goerl Jan 14 '17 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` – Avael Kross Jan 14 '17 at 15:13

2 Answers2

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

Roberto Decurnex
  • 2,514
  • 1
  • 19
  • 28
dyson returns
  • 3,376
  • 4
  • 16
  • 20
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'
Rafał Cieślak
  • 972
  • 1
  • 8
  • 25
  • 1
    I prefer this solution because I don't have to remove the global linking to the latest ImageMagick version. – Valdis Sep 26 '18 at 07: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. – Rafał Cieślak Feb 14 '19 at 11:04