【发布时间】:2014-07-04 05:58:06
【问题描述】:
我正在尝试在我的 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 安装了ImageMagick,在运行gem install rmagick 之前,我用export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.9-1/lib/pkgconfig 设置了MagickCore.pc 的路径,用export C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.9-1/include/ImageMagick-6/ 设置了Wand.h 的路径。
这适用于 Wand,但不适用于 MagickCore,因为我仍然收到 pkg-config: command not found。
我使用 Ruby 1.9.3p545 和 Ruby on Rails 3.2.16。
我该如何解决这个问题?
【问题讨论】:
-
看来您需要安装
pkg-config或更新PATH以包含其位置。从源代码构建需要此实用程序在系统上。 -
pkg-config已经随自制软件一起安装了。你想让我更新什么PATH? -
您确定
pkg-config在您指定的位置吗?请与which pkg-config联系。对我来说,它在/usr/local/bin/pkg-config虽然我使用的是 OSX 10.7.5
标签: ruby-on-rails ruby imagemagick osx-mavericks rmagick