我似乎无法在osx上安装rmagick gem。在将Xcode从4.2降级到4.1后,我通过自制软件安装了imagemagick。这是我rvmsudo gem install rmagick
的输出。从mkmf.log
的输出看起来像链接器问题。我在another post上看到linux的rvm无法找到imagemagick的路径。有什么建议吗?
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/neil/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
checking for clang... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/neil/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
/Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from extconf.rb:193:in `<main>'
Gem files will remain installed in /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/neil/.rvm/gems/ruby-1.9.3-p0/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
这是mkmf.log的输出
checking for Ruby version >= 1.8.5... -------------------- yes
--------------------
find_executable: checking for clang... -------------------- yes
--------------------
find_executable: checking for Magick-config... -------------------- yes
--------------------
checking for ImageMagick version >= 6.4.9... -------------------- yes
--------------------
checking for HDRI disabled version of ImageMagick... -------------------- yes
--------------------
"clang -o conftest -I/Users/neil/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/x86_64-darwin11.2.0 -I/Users/neil/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/Users/neil/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/usr/local/Cellar/imagemagick/6.7.1-1/include/ImageMagick -I/usr/local/Cellar/imagemagick/6.7.1-1/include/ImageMagick -fopenmp conftest.c -L. -L/Users/neil/.rvm/rubies/ruby-1.9.3-p0/lib -L/usr/local/Cellar/imagemagick/6.7.1-1/lib -L/usr/X11/lib -L/usr/local/Cellar/imagemagick/6.7.1-1/lib -lMagickCore -llcms -ltiff -lfreetype -ljpeg -L/usr/X11/lib -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl -lruby.1.9.1 -lpthread -ldl -lobjc "
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */