10

尝试使用 sudo gem install rmagick 在 Mountain Lion 中安装 rmagick 并得到以下结果。任何帮助表示赞赏。论坛的答案都没有奏效。

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for xcrun... 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... yes
checking for InitializeMagick() in -lMagickCore... no
checking for InitializeMagick() in -lMagick... no
checking for InitializeMagick() in -lMagick++... no
Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.
4

4 回答 4

20

这对我有用...

如之前的答案所述:

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

我得到了 magicwand.sh :

$ mdfind MagickWand.h -->
/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/wand/MagickWand.h

然后我取出了除实际文件名之外的整个路径并添加了 C_INCLUDE_PATH= 例如:

/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/wand/
--->
C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/

然后我寻找 MagickCore.pc

$ mdfind MagickCore.pc
/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/MagickCore.pc

与以前相同:

/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/
--->
PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/

然后我将这两个路径与 gem install 一起使用:

$ sudo C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/ PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/ gem install rmagick

经过数小时的研究,它终于奏效了。希望它可以帮助某人。

于 2013-05-13T19:07:57.473 回答
17

使用 Homebrew 重新安装 imagemagick:

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

或者你可以使用这个 shell 脚本安装::

https://github.com/maddox/magick-installer
于 2012-07-31T03:33:50.153 回答
7

我一直在为这个 Rmagick on Mountain Lion 安装问题苦苦挣扎,并尝试了许多不同的解决方案,这就是最终为我解决问题的解决方案:

使用 Homebrew 重新安装 imagemagick:

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

接着

$ gem install rmagick -v '2.13.2'

感谢 Andrew Nesbitt 和 Phillipe Gustavo 发布和编辑此解决方案!

于 2013-03-02T22:39:39.503 回答
1

The following solved it for me:

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

cd /usr/local/Cellar/imagemagick/6.8.8-9/lib
ln -s libMagick++-6.Q16.3.dylib libMagick++.dylib
ln -s libMagickCore-6.Q16.2.dylib libMagickCore.dylib
ln -s libMagickWand-6.Q16.2.dylib libMagickWand.dylib

gem install rmagick  -v '2.12.2'

source: http://winstonyw.com/2013/03/21/installing-imagemagick-and-rmagick/

于 2014-04-03T06:25:54.057 回答