Unable to install rmagick ruby gem on CentOS 7

Posted on

Problem :

gem install rmagick

gives me:

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb
checking for gcc... yes
checking for Magick-config... yes
*** 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}/lib64
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby
extconf.rb:189:in ``': No such file or directory - which (Errno::ENOENT)
    from extconf.rb:189:in `has_graphicsmagick_libmagick_dev_compat?'
    from extconf.rb:66:in `configure_compile_options'
    from extconf.rb:16:in `initialize'
    from extconf.rb:548:in `new'
    from extconf.rb:548:in `<main>'


Gem files will remain installed in /home/redmine/.gem/ruby/gems/rmagick-2.16.0 for inspection.
Results logged to /home/redmine/.gem/ruby/gems/rmagick-2.16.0/ext/RMagick/gem_make.out

I have the ImageMagick and ImageMagick-devel packages. Is there a way to find which package am I missing?

cat /home/redmine/.gem/ruby/gems/rmagick-2.16.0/ext/ 
/usr/bin/ruby extconf.rb
checking for gcc... yes
checking for Magick-config... yes
*** 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}/lib64
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby
extconf.rb:189:in ``': No such file or directory - which (Errno::ENOENT)
    from extconf.rb:189:in `has_graphicsmagick_libmagick_dev_compat?'
    from extconf.rb:66:in `configure_compile_options'
    from extconf.rb:16:in `initialize'
    from extconf.rb:548:in `new'
    from extconf.rb:548:in `<main>'

Solution :

The error output suggests that your server is missing the program named which. Try installing this program.

yum install which

Leave a Reply

Your email address will not be published. Required fields are marked *