LoginSignup
13
8

More than 5 years have passed since last update.

rmagickがgem installできない「Can't install RMagick 2.15.4. Can't find MagickWand.h.」

Posted at
  • MacOS EL Capitan 10.11.6
  • Ruby 2.3.3

Macをクリーンインストールして、会社のプロジェクトを環境構築した時のお話...

$ bundle install
Installing therubyracer 0.12.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
.
.
.
checking for clang... 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.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/taku/.rbenv/versions/2.3.3/bin/$(RUBY_BASE_NAME)

.
.
.
An error occurred while installing rmagick (2.15.4), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.15.4'` succeeds before bundling.

問題は、rmagick さんが ImageMagick 7系に対応してないんですって。
imagemagickのバージョン確認は、こちら。

$ brew info imagemagick
imagemagick: stable 7.0.5-3 (bottled), HEAD

解決方法

手順1

まずは、いったん削除する

$ brew uninstall imagemagick

手順2

6系を再インストール

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/6f014f2b7f1f9e618fd5c0ae9c93befea671f8be/Formula/imagemagick.rb

手順3

もっかいrmagicをインストールする

$ gem install rmagick
13
8
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
8