I'm using Mac OS Sonoma 14.2.1
ruby 2.6.5
imagemagick@6: stable 6.9.13-4
I'm trying to do
gem install rmagick -v 2.16.0
catching it
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /Users/alenavolosina/.rbenv/versions/2.6.5/gemsets/mosreg-base_4/gems/rmagick-2.16.0/ext/RMagick
/Users/alenavolosina/.rbenv/versions/2.6.5/bin/ruby -I /Users/alenavolosina/.rbenv/versions/2.6.5/lib/ruby/2.6.0 -r ./siteconf20240111-64476-m23n6.rb extconf.rb
checking for clang... yes
checking for Magick-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=/Users/alenavolosina/.rbenv/versions/2.6.5/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/alenavolosina/.rbenv/versions/2.6.5/gemsets/mosreg-base_4/extensions/-darwin-23/2.6.0/rmagick-2.16.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/alenavolosina/.rbenv/versions/2.6.5/gemsets/mosreg-base_4/gems/rmagick-2.16.0 for inspection.
Results logged to /Users/alenavolosina/.rbenv/versions/2.6.5/gemsets/mosreg-base_4/extensions/-darwin-23/2.6.0/rmagick-2.16.0/gem_make.out
The command find /usr/local /opt/homebrew -name "MagickWand.h"
issues
/opt/homebrew/Cellar/imagemagick@6/6.9.13-4/include/ImageMagick-6/wand/MagickWand.h
/opt/homebrew/Cellar/imagemagick/7.1.1-26/include/ImageMagick-7/MagickWand/MagickWand.h
i tried it
brew install imagemagick@6 && brew link imagemagick@6 --force
export LDFLAGS="-L/usr/local/opt/imagemagick@6/lib"
export CPPFLAGS="-I/usr/local/opt/imagemagick@6/include"
export PKG_CONFIG_PATH="/usr/local/opt/imagemagick@6/lib/pkgconfig"
brew uninstall pkg-config && brew install pkg-config
PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick -v '2.16.0'
etc.
I tried all stackoverflow and more, tried reinstalling all dependent libraries, I also reinstalled Ruby 2.6.5, using rbenv, I'm at a dead end, please help me, good people
It looks like the
MagickWand.hheader file is missing. You could check themkmf.logfile for more details but here are some things to try that are the usual culprits with issues like these:MagickWand.hon your system, it's likely installed, but it might not be linked properly.MagickWand.hcan helpIf none of these work you could then try uninstalling and reinstalling imagemagick & rmagick. Also make sure you don't have multiple versions installed. This can sometimes cause conflicts. The last thing I can think of would be to try uninstall and reinstall ruby, and also ensure your macOS is up to date as it can sometimes cause issues.