无法安装rmagick,找不到pkg-config:命令

我正在尝试在我的Mac OS X v10.9 (Mavericks)机器上安装rmagick。 然而。 我收到这个错误

/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. 

Magick-config中的第41,17,50,53行是

 --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 ;; 

我使用brew install imagemagick --build-from-source ,在运行gem install rmagick之前,我设置了export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.9-1/lib/pkgconfigexport C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.9-1/include/ImageMagick-6/

这适用于魔杖,但不适用于MagickCore,因为我仍然pkg-config: command not found

我使用Ruby 1.9.3p545和Ruby on Rails 3.2.16。

我该如何解决这个问题?

升级到Maverick后,我和Rmagick有同样的问题。 这解决了它:

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

重新安装pkg-config为我解决了这个问题。

brew install pkg-config为我修复了这个问题。