0

I have an old Rails app I maintain which uses Ruby 1.8.6. I'm trying to get a new install of Linux Mint 18 up and running so I can develop for the app. I managed to install the same (almost) version of ImageMagick as I have on the server, and am not struggling to install the rmagick gem.

I need to install rmagick v2.2.2, since this is what we have on the server. But, i'm getting this error, see below:

$ gem install rmagick -v 2.2.2
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

/home/max/.rvm/rubies/ruby-1.8.6-p420/bin/ruby extconf.rb
checking for Ruby version >= 1.8.2... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.3.0... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for magick/MagickCore.h... yes
checking for InitializeMagick() in -lMagick... no
checking for InitializeMagick() in -lMagickCore... no
Can't install RMagick 2.2.2. Can't find libMagick or one of the dependent libraries. Check the mkmf.log file for more detailed information.


Gem files will remain installed in /home/max/.rvm/gems/ruby-1.8.6-p420@elearning-resource/gems/rmagick-2.2.2 for inspection.
Results logged to /home/max/.rvm/gems/ruby-1.8.6-p420@elearning-resource/gems/rmagick-2.2.2/ext/RMagick/gem_make.ou

It looks like I maybe need to install some other dependency with apt-get but I'm not sure what. Even if I knew then I think i might need to install an older version in order to go with the older version of ImageMagick that I have?

The mkmf.log file is here: http://pastebin.com/h9dbGr1k

Grateful for any advice - thanks!

0

Configure cannot find the function InitializeMagick(), because newer versions of ImageMagick pass an extra argument to that function. For the signature your version of RMagick is looking for, you probably need ImageMagick <= 6.4.1, as described here, which will not be available as a package in your distribution. However, it might be worth to try modifying the gem to build with a more recent version of ImageMagick, because a library this old often has many known vulnerabilities, e.g. for this example CVE-2016–3714 or CVE-2012-1185 with can both lead to remote code execution when parsing an image...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.