在 Mac OS X 上安装 Rmagick 时出错
我按照 RMagick 安装了 OSX: http://rmagick.rubyforge.org/install-faq.html#osx
我已经从 John Maddux 完成了 Imagemagick 安装(将 ImageMagick 安装在OSX 不使用 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$
非常感谢您的帮助, 苏帕特
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我强烈建议你尝试 homebrew,它是 macports 的一个很好的替代品:
一旦你安装了 homebrew,你应该能够安装 imagemagick 并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 和这个答案 )
如果您在安装 chiliproject 时遇到问题,请尝试在没有 openpmp 的情况下安装:
更新 X2:(感谢 Ramon Araujo的评论)
如果您之前安装过imagemagick使用自制程序,您必须在再次安装之前取消链接:
I would strongly recommend you try homebrew, which is a great replacement for macports:
Once you get homebrew installed, you should be able to install imagemagick and rmagick very easily:
More info here:
http://www.codedrop.ca/blog/archives/214
and here:
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/
UPDATE: (thanks to JJD and this answer)
Try to install without openpmp if you are having trouble with a chiliproject install:
UPDATE X2: (thanks to Ramon Araujo's comment)
If you have previously installed imagemagick with homebrew, you will have to unlink it before you install again:
另一个需要注意的是 imagemagick 的版本。
我有 ImageMagick 版本 6.8.0,如果您从自制软件安装,这是最新的版本,而 rmagick 无法使用该版本进行编译。
所以做一个
并确保您的 ImageMagick 是 6.7 或更低,否则 rmagick 将无法编译。
Another think to watch out is the version of imagemagick.
I had ImageMagick version 6.8.0, which is the latest if you install from homebrew, and rmagick just does not compile with this version.
So do a
and make sure that your ImageMagick is 6.7 or less otherwise rmagick wont compile..
与这个问题斗争了一段时间,下面的修复(复制自这个SO答案解决了这个问题(特别是关于 您
rmagick 在使用 homebrew 的 imagemagick (>= 6.8.0-10) 时出现问题。
可以
通过更新 rmagick gem
或手动符号链接一些 dylib 来使其工作:
之后
gem install rmagick 可以工作。
应该 /homebrew/issues/16625
Struggled with this problem for a while, and the fix below (copied from this SO answer solved the issue (specifically the section about symbolic links).
rmagick has a problem working with imagemagick (>= 6.8.0-10) from homebrew.
You can either
update rmagick gem by
or manually symbol link some dylib to make it work:
After that
gem install rmagick
should work.Check the discussion about this in https://github.com/Homebrew/homebrew/issues/16625