gpt4 book ai didi

ruby-on-rails - 无法在 Mountain Lion 中安装 rmagick

转载 作者:行者123 更新时间:2023-12-04 02:31:30 25 4
gpt4 key购买 nike

尝试使用 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.

最佳答案

这对我有用...

正如之前的答案所述:

$ 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

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

关于ruby-on-rails - 无法在 Mountain Lion 中安装 rmagick,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11711967/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com