无法安装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/pkgconfig
和export 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
为我修复了这个问题。
- 在OS X El Capitan上,gem install rmagick失败
- 使用透明背景将PDF转换为PNG
- 带有ImageMagick和Rails的像素RGB
- JPG到PNG使用RMagick
- Gem Rmagick安装错误:extconf.rb:171:在“’:没有这样的文件或目录 – convert -version(Errno :: ENOE NT)
- 作物与蜻蜓铁路的圆形图像
- Rails – 可以将PDF转换为图像?
- Ruby on Rails错误:“未定义的方法`call”表示“result == false”:字符串“create method中的错误
- 无法在Windows 7上安装Rmagick和Imagemagick