2015-10-19 77 views
8

我一個前兩天升級到埃爾卡皮坦就跑造成Ruby的rmagick寶石停止工作一創業板安裝rmagick未能在OS X上埃爾卡皮坦

brew update && brew upgrade 

它更新ImageMagick的。

沒問題,我想,我跑

gem install rmagick 

,它會重新編譯。

除非事與願違,當我運行它,我看到這一點:

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

    /Users/sam/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20151019-57347-30ju1w.rb extconf.rb 
checking for clang... yes 
checking for Magick-config... yes 
checking for outdated ImageMagick version (<= 6.4.9)... no 
checking for Ruby version >= 1.8.5... 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/sam/.rbenv/versions/2.2.3/bin/$(RUBY_BASE_NAME) 
/Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:321:in `open' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:321:in `open' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:347:in `postpone' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for' 
    from /Users/sam/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header' 
    from extconf.rb:38:in `configure_headers' 
    from extconf.rb:18:in `initialize' 
    from extconf.rb:517:in `new' 
    from extconf.rb:517:in `<main>' 

extconf failed, exit code 1 

Gem files will remain installed in /Users/sam/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rmagick-2.15.4 for inspection. 
Results logged to /Users/sam/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/rmagick-2.15.4/gem_make.out 

這裏是mkmf.log

find_executable: checking for clang... -------------------- yes 

-------------------- 

find_executable: checking for Magick-config... -------------------- yes 

-------------------- 

configure_compile_options: checking for outdated ImageMagick version (<= 6.4.9)... -------------------- no 

Detected ImageMagick version: 6.9.2 
-------------------- 

assert_minimum_ruby_version!: checking for Ruby version >= 1.8.5... -------------------- yes 

-------------------- 

"clang -o conftest -I/Users/sam/.rbenv/versions/2.2.3/include/ruby-2.2.0/x86_64-darwin14 -I/Users/sam/.rbenv/versions/2.2.3/include/ruby-2.2.0/ruby/backward -I/Users/sam/.rbenv/versions/2.2.3/include/ruby-2.2.0 -I. -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 conftest.c -L. -L/Users/sam/.rbenv/versions/2.2.3/lib -L/usr/local/Cellar/imagemagick/6.9.2-4/lib -lMagickCore-6.Q16  -L/usr/local/Cellar/imagemagick/6.9.2-4/lib -lMagickCore-6.Q16 -lruby-static -framework CoreFoundation -lpthread -lgmp -ldl -lobjc " 
ld: library not found for -lgmp 
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(int argc, char **argv) 
4: { 
5: return 0; 
6: } 
/* end */ 

任何想法的內容是什麼?

回答

17

修正了它。

神奇的命令來運行是這樣的:

xcode-select --install 
+0

請您詳細說明一下嗎?我需要xcode嗎? – masciugo

0

我已經升級到薩爾瓦多卡皮塔諾後有同樣的問題。我在以前版本的操作系統下安裝了rvm和ruby。重新安裝紅寶石解決了我的問題。如果您正在使用rvm,請運行rvm reinstall [your-ruby-version]。之後,您應該可以安裝rmagick gem。希望有所幫助。

相關問題