本文介绍了在 Mac OS X 上安装 Rmagick 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了 RMagickOSX 安装:http://rmagick.rubyforge.org/install-faq.html#osx

我已经完成了 John MadduxImagemagick 安装(安装 ImageMagick 的解决方案em> 在 OSX 上不使用 MacPorts)

I have done the Imagemagick installation from John Maddux (solution to install ImageMagick on OSX without using MacPorts)

这是我的终端窗口:

Suebphatt:~ suebphattleelertphong$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

Suebphatt:~ suebphattleelertphong$ rails -v
Rails 3.0.3

Suebphatt:~ suebphattleelertphong$ gem -v
1.3.7

Suebphatt:~ suebphattleelertphong$ gem install rmagick
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for     inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
Suebphatt:~ suebphattleelertphong$

非常感谢您的帮助,苏柏特

Thanks a lot for help,Suebphatt

推荐答案

我强烈建议您尝试使用 homebrew,它是 macports 的绝佳替代品:

I would strongly recommend you try homebrew, which is a great replacement for macports:

安装 homebrew 后,您应该能够非常轻松地安装 imagemagick 和 rmagick:

Once you get homebrew installed, you should be able to install imagemagick and rmagick very easily:

brew install imagemagick     # will take a while!
gem install rmagick

更多信息在这里:

http://www.codedrop.ca/blog/archives/214

这里:

http://weblogs.manas.com.ar/mverzilli/2010/05/19/install-the-rmagick-gem-in-the-painless-way-with-homebrewinstall-the-rmagick-gem-in-the-painless-way-with-homebrewinstall-the-rmagick-gem-in-the-painless-way-with-homebrewinstall-the-rmagick-gem-in/

更新:(感谢 JJD这个答案)

UPDATE: (thanks to JJD and this answer)

如果您在安装辣椒项目时遇到问题,请尝试不使用 openpmp 进行安装:

Try to install without openpmp if you are having trouble with a chiliproject install:

brew install imagemagick --disable-openmp

更新 X2:(感谢 Ramon Araujo评论)

UPDATE X2: (thanks to Ramon Araujo's comment)

如果你之前用 homebrew 安装过 imagemagick,你必须在再次安装之前取消链接:

If you have previously installed imagemagick with homebrew, you will have to unlink it before you install again:

brew unlink imagemagick

这篇关于在 Mac OS X 上安装 Rmagick 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 20:31