Can't install rmagick, pkg-config: command not found

主宰稳场 提交于 2019-11-29 06:58:38

问题


I'm trying to install rmagick on my Mac OS X v10.9 (Mavericks) machine. However. I get this error

/usr/local/bin/Magick-config: line 41: pkg-config: command not found
/usr/local/bin/Magick-config: line 47: pkg-config: command not found
/usr/local/bin/Magick-config: line 50: pkg-config: command not found
/usr/local/bin/Magick-config: line 53: pkg-config: command not found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... yes
/usr/local/bin/Magick-config: line 53: pkg-config: command not found
Can't install RMagick 2.13.2. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.

The lines 41,17,50,53 in Magick-config are

--cflags)
  pkg-config --cflags MagickCore
  ;;
--cxxflags)
  pkg-config --cflags MagickCore
  ;;
--cppflags)
  pkg-config --cflags MagickCore
  ;;
--ldflags)
  pkg-config --libs MagickCore
  ;;
--libs)
  pkg-config --libs MagickCore
  ;;

I installed ImageMagick with brew install imagemagick --build-from-source and before running gem install rmagick, I set the path to MagickCore.pc with export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.9-1/lib/pkgconfig and the path to Wand.h with export C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.9-1/include/ImageMagick-6/.

This worked for the Wand, but not for MagickCore, as I still get pkg-config: command not found.

I use Ruby 1.9.3p545 and Ruby on Rails 3.2.16.

How can I fix this problem?


回答1:


I had the same issue with Rmagick after upgrading to Maverick. This solved it:

brew uninstall pkg-config
brew install pkg-config
brew unlink pkg-config && brew link pkg-config



回答2:


Reinstalling pkg-config solved the issue for me.




回答3:


brew install pkg-config fixed this for me.



来源:https://stackoverflow.com/questions/23684133/cant-install-rmagick-pkg-config-command-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!