rmagick: ERROR: Can't install RMagick 4.0.0. Can't find ImageMagick with pkg-config
Hello, I upgraded imagemagick version to 6.9.11 and when i try install rmagick gem, i get following error:
# mkmf.log
find_executable: checking for brew... -------------------- yes
--------------------
find_executable: checking for gcc... -------------------- yes
--------------------
find_executable: checking for pkg-config... -------------------- yes
--------------------
ERROR: Can't install RMagick 4.0.0. Can't find ImageMagick with pkg-config
current directory: /Users/michalmacku/.rvm/gems/ruby-2.6.5/gems/rmagick-4.1.0.rc2/ext/RMagick
/Users/michalmacku/.rvm/rubies/ruby-2.6.5/bin/ruby -I /Users/michalmacku/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200309-20030-8vw80k.rb extconf.rb
checking for brew... yes
checking for gcc... yes
checking for pkg-config... yes
[31m[1mERROR: Can't install RMagick 4.1.0.rc2. Can't find ImageMagick with pkg-config
[0m
*** 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
--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/michalmacku/.rvm/rubies/ruby-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/michalmacku/.rvm/gems/ruby-2.6.5/extensions/x86_64-darwin-19/2.6.0/rmagick-4.1.0.rc2/mkmf.log
extconf failed, exit code 1
I had installed pkg-config on my system. I tried to reinstall imagemagick and pkg-config but problem persists. Similar problem looks like https://github.com/rmagick/rmagick/issues/956 but that solution not working for me. Imagemagick version 6.9.10 working without problem, but after upgrade it via Homebrew i cannot go back to previous version.
My operating system is MacOS.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (5 by maintainers)
I was blocked by this as well with the same
pkg-config --list-allsegfault behavior. Changing the env variablesPKG_CONFIG_PATHandPKG_CONFIG_LIBDIRdidn’t seem to change the paths used, which I believe can be checked by runningpkg-config --variable pc_path pkg-config. I was able to debug that by runningpkg-config --debug --list-allwhich segfaulted whileParsing package file '/usr/local/lib/pkgconfig/proj.pc'. The package PROJ was updated 11 days ago and that runningpkg-config --exists --print-errors "proj"results inVariable 'datarootdir' not defined in '/usr/local/lib/pkgconfig/proj.pc'. Removing /usr/local/lib/pkgconfig/proj.pc (renaming it to proj.pc.backup) and re-running the RMagick install succeeded! Will be opening an issue forPROJ, and attempting to downgradePROJfrom 7.0.0 for now. Hope this helps! Doesn’t seem to be an issue with RMagick, although maybe the determine_imagemagick_package method could be modified to not use--list-allas a workaround.is there a longer term fix planned than the current workaround to
?
Unfortunately I used to still get the same 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.This worked for me!
Looks like
pkg-configon your sysytem have some damage… You need to solve the segmentation fault at first. You may solve the problem by reinstallingpkg-config. (exbrew reinstall --force pkgconfig)For me, the issue was not with
proj.pcbut withlibhwy-test. Running an Apple M1 Pro Chip. Ran the same solution as above and could install rmagick fine. I don’t like the idea of just removing a file for what seems like a dependency but I will say that it worked.Can you paste the following command log?