Can't install RMagick 2.15.4. Can't find MagickWand.h

时间:2017-08-14 07:08:11

标签: ruby install rmagick

While I'm trying to install rmagic, it shows following error

ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

/Users/***/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20170814-
44982-1i5w4mc.rb extconf.rb
checking for gcc... yes
checking for Magick-config... no
checking for pkg-config... yes
checking for outdated ImageMagick version (<= 6.4.9)... no
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.15.4. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

I'm using MacOS sierra, ruby version 2.2.3

2 个答案:

答案 0 :(得分:6)

我有一段时间没有这个问题。你需要安装imagemagick。根据rmagic gem的github回购

  

预请求数:

     

ImageMagick版本6.4.9或更高版本。你可以从www.imagemagick.org获得ImageMagick。

我相信你也可以用brew安装它

$ brew install imagemagick@6
$ brew link imagemagick@6 --force
$ gem install rmagick

答案 1 :(得分:0)

brew unlink pkgconfig
bundle install
brew link pkgconfig

为我做了伎俩