.logbook

学んだことを書き綴る、言わば航海日誌です。

bundle installにてrmagickのインストールに失敗

Redmine3.0.0をインストールしようと「bundle install」を実行すると失敗した。

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/user/.rbenv/versions/2.1.1/bin/ruby extconf.rb 
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... *** 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/user/.rbenv/versions/2.1.1/bin/ruby
extconf.rb:154:in ``': No such file or directory - convert (Errno::ENOENT)
    from extconf.rb:154:in `block in <main>'
    from /home/user/.rbenv/versions/2.1.1/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
    from /home/user/.rbenv/versions/2.1.1/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /home/user/.rbenv/versions/2.1.1/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /home/user/.rbenv/versions/2.1.1/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
    from /home/user/.rbenv/versions/2.1.1/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /home/user/.rbenv/versions/2.1.1/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
    from /home/user/.rbenv/versions/2.1.1/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
    from extconf.rb:151:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /home/user/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rmagick-2.13.4 for inspection.
Results logged to /home/user/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/extensions/x86-linux/2.1.0-static/rmagick-2.13.4/gem_make.out
An error occurred while installing rmagick (2.13.4), and Bundler cannot
continue.
Make sure that `gem install rmagick -v '2.13.4'` succeeds before bundling.

どうやらimagemagickがインストールされていないことが問題らしい。 以下のコマンドを実行して、再度bundle installし直すと解決した。

$ sudo apt-get install imagemagick