ubuntu14.04にgemでrmagickをインストール
まず、gem install してみる
$ gem install rmagick -v '2.14.0'
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/home/hoge/.rbenv/versions/2.1.5/bin/ruby extconf.rb
checking for gcc... yes
checking for Magick-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.14.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.
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=/home/hoge/.rbenv/versions/2.1.5/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in /home/hoge/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rmagick-2.14.0 for inspection.
Results logged to /home/hoge/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/rmagick-2.14.0/gem_make.out
どうやら、なにかライブラリーが足りていない感じ
以下のコマンドを実行
$ sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
再度gem iするとインストールされた
$ gem install rmagick -v '2.14.0'
Building native extensions. This could take a while...
Successfully installed rmagick-2.14.0
1 gem installed