Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
40
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

Mac OS X環境にrmagickをインストールする決定版

盛大にハマったのでメモ。

こんなエラーが出てるなら役に立つかもしれません。

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

    /Users/user/.rbenv/versions/2.1.1/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for clang... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
/usr/local/bin/Magick-config: line 41: pkg-config: command not found
/usr/local/bin/Magick-config: line 47: pkg-config: command not found
/usr/local/bin/Magick-config: line 50: pkg-config: command not found
/usr/local/bin/Magick-config: line 53: pkg-config: command not found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.2. 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.
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

    /Users/user/.rbenv/versions/2.1.1/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for clang... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in ...

なにはともあれImageMagickをインストール
既に入ってたら再インストールした方が良いかもです。

brew install imagemagick

続けてpkg-configもインストール
これも再インストール推奨です
※自分の環境ではこれを再インストールして上手くいきました

brew install pkg-config

ここでやっとこさrmagickが入りました。

gem install rmagick

この件に関する記事は沢山見つかったのですが、
pkg-configを再インストールするのは見た事の無いパターンだったので残しておきます。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
40
Help us understand the problem. What are the problem?