在OS X El Capitan上,gem install rmagick失败 [英] gem install rmagick fails on OS X El Capitan

查看:167
本文介绍了在OS X El Capitan上,gem install rmagick失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我几天前升级到El Capitan并且运行了

I upgraded to El Capitan a couple of days ago and ran a

brew update && brew upgrade

它更新了imagemagick,导致ruby的rmagick gem停止工作。

It updated imagemagick which caused ruby's rmagick gem to stop working.

没问题我想,我只会跑

gem install rmagick

它将重新编译。

除非没有,当我运行它时,我看到:

Except it didn't, when I run it I see this:

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的内容

Here is the contents of 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 */

任何想法?

推荐答案

修正了它。

运行的神奇命令是:

xcode-select --install

这篇关于在OS X El Capitan上,gem install rmagick失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆