【问题标题】:Can't install rmagick, pkg-config: command not found无法安装 rmagick,pkg-config:找不到命令
【发布时间】: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


【解决方案1】:

升级到 Maverick 后,我在使用 Rmagick 时遇到了同样的问题。这解决了它:

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

【讨论】:

  • 就我而言,brew uninstall pkg-config 失败了,所以我只运行了brew install pkg-config,这就解决了我的问题。
  • 是的!!!!经过几个小时尝试所有其他 StackOverflow 解决方案均未成功,这终于让我安装了 rmagick gem。谢谢!
【解决方案2】:

brew install pkg-config 为我解决了这个问题。

【讨论】:

    【解决方案3】:

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

    【讨论】:

      猜你喜欢
      • 2011-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-21
      • 1970-01-01
      • 2011-04-23
      • 2017-07-04
      相关资源
      最近更新 更多