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.
I used to get an error and also the rmagick installation issue:
pkg-config has version 0.29.2, I tried both removing the
proj.pcfile 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. Runningpkg-config --debug --list-allwill show that.