Bundle无法在Mac OSX 10.7上安装RMagick gem。

24
我已经使用ImageMagick安装程序脚本https://github.com/maddox/magick-installer安装了ImageMagick。我正在使用RVM,Ruby 1.9.3p125,OSX Lion 10.7。问题似乎出现在MagickWand.h文件中,以下是完整日志。
/Users/pdjimeno/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
checking for /usr/bin/gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.1. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/pdjimeno/.rvm/rubies/ruby-1.9.3-p125/bin/ruby

http://superuser.com/questions/400179/gcc-on-os-x-lion-with-xcode-4-3-1 - Niels Kristian
12个回答

2

就我所知,我曾在使用Ruby ree-1.8.7-2012-02时遇到过这个问题。以下是我解决它的方法:

我卸载了ImageMagick并重新安装了它。

brew remove imagemagick 
brew install imagemagick --disable-openmp --build-from-source

然后我在 /usr/local/Cellar/imagemagick/6.8.9-7/lib/ 目录下添加了这些符号链接。

ln -s libMagick++-6.Q16.5.dylib libMagick++.dylib
ln -s libMagickCore-6.Q16.2.dylib libMagickCore.dylib
ln -s libMagickWand-6.Q16.2.dylib libMagickWand.dylib

我接着卸载了 Ruby 版本并重新安装了它。
rvm remove ree-1.8.7-2012-02
rvm install ree-1.8.7-2012-02

最终安装了宝石(Gem)

gem install rmagick -v '2.12.2'

希望这能有所帮助。

1

我不得不添加两个环境变量才能使其正常工作。类似这样:

C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/ PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/Cellar/imagemagick/6.7.7-6/lib/pkgconfig/ gem install rmagick 

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接