Can't install RMagick 4.2.6 on MacOS BigSur

246 Views Asked by At

Whenever I try to install rmagick I get ERROR: Can't install RMagick 4.2.6. Can't find ImageMagick with pkg-config. I tried all the other options, with installing imagemagick@6, setting PKG_CONFIG_PATH, unlinking, reinstalling & linking imagemagick, setting the pkg-config path from the lib folder of imagemagick, nothing worked.

More detailed error:

checking for brew... yes
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes


ERROR: Can't install RMagick 4.2.6. Can't find ImageMagick with pkg-config


*** 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.
1

There are 1 best solutions below

3
Victor Motogna On

I used to get an error and also the rmagick installation issue:

pkg-config --list-all
[1]    664 segmentation fault  pkg-config --list-all

pkg-config has version 0.29.2, I tried both removing the proj.pc file and changing it to the details from this comment.

pkg-config --exists --print-errors "proj" even returns nothing, so I don't think there's an error on that side.

I managed to fix the issue by uninstall highway (brew uninstall highway), because it has a conflict over a variable. Running pkg-config --debug --list-all will show that.