【问题标题】:Can't install RMagick 2.15.4. Can't find MagickWand.h无法安装 RMagick 2.15.4。找不到 MagickWand.h
【发布时间】:2017-08-14 07:08:10
【问题描述】:

当我尝试安装 rmagic 时,它显示以下错误

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.

我使用的是 MacOS sierra,ruby 版本 2.2.3

【问题讨论】:

    标签: ruby installation rmagick


    【解决方案1】:

    我不久前遇到过这个问题。您需要安装 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
    

    【讨论】:

    • Imagemagick v7+ 出现问题,artofbeing 解决方案可以帮助您从 Imagemagick 7 降级到 6 并使 RMagick gem 安装工作。
    【解决方案2】:
    brew unlink pkgconfig
    bundle install
    brew link pkgconfig
    

    帮我搞定了

    【讨论】:

      猜你喜欢
      • 2012-02-21
      • 2017-01-22
      • 2017-07-04
      • 2023-03-29
      • 1970-01-01
      • 2011-04-23
      • 2015-04-04
      • 2014-07-04
      • 1970-01-01
      相关资源
      最近更新 更多