【问题标题】:Can't install rmagick in Mountain Lion无法在 Mountain Lion 中安装 rmagick
【发布时间】:2012-07-29 18:48:59
【问题描述】:

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

【问题讨论】:

  • 你先安装了imagemagick吗?
  • 是的,可能 imagemagick 没有安装。我建议使用 homebrew 在 mac 上安装 imagemagick。

标签: ruby-on-rails


【解决方案1】:

这对我有用...

如前面的答案所述:

$ 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

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

【讨论】:

  • 肯定帮助了至少一个人:D
  • 非常感谢您!我按照上述步骤(删除并重新安装)但仍然收到错误“无法安装 RMagick 2.13.2。找不到 MagickWand.h。”然后我按照您的步骤进行操作,一切顺利。 (我使用的是 rvm,所以我不需要 sudo)你为我节省了很多时间和头疼的问题,谢谢!
  • 是的!终于经过一番摸索。这样做了
【解决方案2】:

用 Homebrew 重新安装 imagemagick:

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

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

https://github.com/maddox/magick-installer

【讨论】:

  • 最终重新安装了 OS X。感谢您的回复。
  • 要使用 Homebrew 重新安装,第二个命令应该是“brew install imagemagick --disable-openmp --build-from-source” 我把头撞在墙上一段时间,直到我意识到这一点。但是,如果您注意,您会发现如果没有该标志的“构建”部分,从源代码构建太快了。
  • 有点晚了,但你是救命稻草
【解决方案3】:

我一直在为这个 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 发布和编辑此解决方案!

【讨论】:

    【解决方案4】:

    以下为我解决了它:

    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'
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-21
      • 2012-12-06
      • 2013-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多