Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I appreciate this question has been asked many times before, however I've tried all available answers to no avail. The error log is as follows:

have_header: checking for wand/MagickWand.h... -------------------- no

"gcc -E -I/Users/mark/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0/x86_64-darwin16 -I/Users/mark/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0/ruby/backward -I/Users/mark/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0 -I.  -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/imagemagick/7.0.4-8/include/ImageMagick-7  -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/imagemagick/7.0.4-8/include/ImageMagick-7  conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'wand/MagickWand.h' file not found
#include <wand/MagickWand.h>
     ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <wand/MagickWand.h>
/* end */

After running mdfind MagickWand.h I can see the path is:

/usr/local/Cellar/imagemagick/7.0.4-8/include/ImageMagick-7/MagickWand/MagickWand.h

I then run:

C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/7.0.4-8/include/ImageMagick-7/MagickWand/ gem install rmagick

However get the same message as before.

Any help for how to get this solved is greatly appreciated.

like image 274
Mark Avatar asked Feb 15 '17 13:02

Mark


2 Answers

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.

like image 160
Trip Avatar answered Nov 09 '22 16:11

Trip


Worked this one for me at osx sierra

brew unlink imagemagick
brew install imagemagick@6 && brew link imagemagick@6 --force
echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile

Got it here RMagick installation: Can't find MagickWand.h

like image 19
Mizanur Rahman Mojumder Avatar answered Nov 09 '22 15:11

Mizanur Rahman Mojumder