Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
596 views
in Technique[技术] by (71.8m points)

macos - Error installing Rmagick on Mac OS X

I followed the installation of RMagick for OSX: http://rmagick.rubyforge.org/install-faq.html#osx

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

Here's my terminal window:

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

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

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:

brew install imagemagick --disable-openmp

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:

brew unlink imagemagick

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...