OS X EI Capitan 10.11.1。。曾经我在执行了 brew update && brew upgrade 以后我的 rails c 什么的就跑不起来了。。报了个 image 的错误,然后我就脑抽得卸载了 rmagick,bundle exec gem uninstall rmagick,并且选择了 all versions..然后就是用尽浑身解数也装不回去了。。执行 sudo gem install rmagick 一直提示
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/apple/.rbenv/versions/2.2.0-dev/bin/ruby -r ./siteconf20160108-2705-15xzewu.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/apple/.rbenv/versions/2.2.0-dev/bin/$(RUBY_BASE_NAME)
/Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:457:in try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:588:in
try_cpp'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:1091:in block in have_header'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:942:in
block in checking_for'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:351:in block (2 levels) in postpone'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:321:in
open'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:351:in block in postpone'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:321:in
open'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:347:in postpone'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:941:in
checking_for'
from /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/2.3.0/mkmf.rb:1090: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 `
extconf failed, exit code 1
Gem files will remain installed in /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/gems/2.3.0/gems/rmagick-2.15.4 for inspection. Results logged to /Users/apple/.rbenv/versions/2.2.0-dev/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-14/2.3.0-static/rmagick-2.15.4/gem_make.out
我重装了 brew install imagemagick,还是不能 sudo gem install rmagick 查了很多,居然大多都是在 window 上装才会出现这种错误信息。。可是我 OS X 诶。。于是就蛋疼了。。
这个到底是为毛啊。。。跪求!
我也怀疑我是不是搞了点 npm 的东西。。结果把这个 navite 搞坏了。。但是想想又不大可能吧。。