(谢谢maxple的答案!这有效)
我正在尝试在macOS 10.12(Sierra)上安装Rails.我正在使用终端使用此命令安装它:
$ sudo gem install rails
Run Code Online (Sandbox Code Playgroud)
这会产生以下输出:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /Users/paullantow/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.7.0.1/ext/nokogiri
/Users/paullantow/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20170111-22393-xqzt1j.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with …Run Code Online (Sandbox Code Playgroud)