ImageMagick 7 with RMagick 2.16 on MacOS Sierra Can't find MagickWand.h
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
RMagick installation: Can't find MagickWand.h
Something was severely wrong on my system, so badly that it was completely f*d up, but I was finally to able to install RMagick for Ruby 1.8.7 again after I installed
- an older version of ImageMagick with Homebrew
- a new Ruby version of 1.8.7
- a new version of GCC
The installation of a new Ruby version with RVM rvm install 1.8.7
also installed a new GCC compiler: it removed an older GCC version 4.6 and installed GCC version 4.9. Apparently GCC was not able to find the right headers despite pkg-config.
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.
Can't install RMagick 2.13.1. Can't find MagickWand.h.
I had a similar issue with running
$ gem install rmagick
First of all, do you have imagemagick installed? If you're not sure, run
$ convert --version
If you do, you probably either installed it with fink or macports (maybe homebrew?). What is happening is that rvm can't find the imagemagick directory.
After reading
https://superuser.com/questions/361435/i-have-compiled-imagemagick-on-my-centos-and-rmagick-wont-install
I exported the imagemagick path by adding
$ export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH"
to my ~/.bash_profile, sourcing the new profile, then running:
gem install rmagick
It worked for me after I did this.
Installing RMagick gem -- Can't find MagickWand.h
Turns out the answer was in Can't install RMagick 2.13.1. Can't find MagickWand.h. after all. I had just followed the suggestion incorrectly.
C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick gem install rmagick
This installed rmagick gem successfully.
Unfortunately, rmagic is still not working with CarrierWave :-(, but that is a different problem altogether.
Can't install RMagick 2.15.4. Can't find MagickWand.h
I had this issue a while back. You need to install imagemagick. Per the github repo for the rmagic gem
Pre-reqs:
ImageMagick Version 6.4.9 or later. You can get ImageMagick from www.imagemagick.org.
I believe you can also install it with brew
$ brew install imagemagick@6
$ brew link imagemagick@6 --force
$ gem install rmagick
Rails and OS X: How to install rmagick?
rmagick has a problem working with imagemagick (>= 6.8.0-10) from homebrew.
You can either
update rmagick
gem by
bundle update rmagick
or manually symbol link some dylib to make it work:
$ cd "`Magick-config --prefix`lib"
$ ln -s libMagick++-Q16.7.dylib libMagick++.dylib
$ ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib
$ ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib
After that gem install rmagick
should work.
Check the discussion about this in homebrew/issues/16625
Update:
Thanks @faraz for the nice one-liner command:
cd "`Magick-config --prefix`/lib"; ln -s libMagick++-Q8.7.dylib libMagick++.dylib; ln -s libMagickCore-Q8.7.dylib libMagickCore.dylib; ln -s libMagickWand-Q8.7.dylib libMagickWand.dylib
Related Topics
Rails Model Name Conflict with Included Gem
How to Make :Level Change Based on :Committed Days
Strip Signatures and Replies from Emails
Rake VS. Thor for Automation Scripts
Should I Define a Main Method in My Ruby Scripts
Why 'Self' Method of Module Cannot Become a Singleton Method of Class
How to Calculate the Offset, in Hours, of a Given Timezone from Utc in Ruby
How to Turn Off Automatic Stylesheet/JavaScript Generation on Rails 3.1
Is It Right to Assign Multiple Variables Like This a = B = C = D = 5
How to Remove All Non - Ascii Characters from a String in Ruby
How to Emit Comments in a Yaml Document Using Psych
How to Export Environment Variable Permanently Using Ruby
How to Log Every Method That's Called in a Ruby Program
How to Handle Constants in Ruby When Using Rails