gem install rmagickでエラーが出る
rmagickをインストールしようとすると以下のようなエラーが出ました。
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 presence of MagickWand API (ImageMagick version >= 6.9.0)... 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.16.0. 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.
どうやら最新のhomebrewではImageMagickの新しいバージョンが入ってしまうためにインストールができないようです。
ですので、ImageMagick6系をインストールします。
$ brew install imagemagick@6
$ brew link --force imagemagick@6
$ echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile
$ bundle install
問題無くRmagickがインストールできました。