screengif
screengif copied to clipboard
RMagick fails to install with ImageMagick 7
$ sudo gem install screengif
Fetching: rmagick-2.16.0.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing screengif:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for xcrun... 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.
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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/rmagick-2.16.0 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/rmagick-2.16.0/ext/RMagick/gem_make.out
The issue is due to the fact that ImageMagick 7 has moved its headerfiles and RMagick can't find them when compiling.
The easiest thing I've found to do is to use imagemagick 6 until the upstream issue is fixed.
brew uninstall imagemagick
brew install imagemagick@6 && brew link imagemagick@6 --force
The rmagick team finished compatibility with ImageMagick 7 in March 2020 in rmagick 4.1.0 and later. It might be worth testing then updating screengif's README and gemspec
(see https://github.com/rmagick/rmagick/issues/256#issuecomment-602230953 )