ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking if the C compiler accepts ... *** 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 mayneed configuration options.
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking if the C compiler accepts ... *** 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 mayneed configuration options.
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7.1/ext/nokogiri/gem_make.out
在安装taobaogem的时候sudo gem install rails可能会遇到这样的错误,如图:
解决办法如下:
第一步:
sudo gem update --system
第二步:
xcode-select --install
第三步:
sudo gem install compass
第四步:
重新运行:sudo gem install rails,执行过程中会提示是否重新覆盖,输入y:Overwrite the executable? [yN] y 如图: