Ruby on rails 在Maverick中的Rails中安装Ruby时出错

Ruby on rails 在Maverick中的Rails中安装Ruby时出错,ruby-on-rails,rubygems,extconf.rb,Ruby On Rails,Rubygems,Extconf.rb,我已经尝试过在这里发布的类似问题上提供的多种解决方案,但似乎没有任何效果。我不能安装Rails。错误信息如下。另外,如果我尝试使用Xcode选择--install安装Xcode,它会给我一个网络安装由于网络原因无法下载,请告知。我是Ruby的新手,因此非常感谢您的帮助。干杯 nmacaule-mn1:~ nmacaule$ gem install rails --no-ri --no-rdoc Building native extensions. This could take a whil

我已经尝试过在这里发布的类似问题上提供的多种解决方案,但似乎没有任何效果。我不能安装Rails。错误信息如下。另外,如果我尝试使用
Xcode选择--install
安装Xcode,它会给我一个网络安装
由于网络原因无法下载,请告知。我是Ruby的新手,因此非常感谢您的帮助。干杯

nmacaule-mn1:~ nmacaule$ gem install rails --no-ri --no-rdoc
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

    /Users/nmacaule/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150209-56320-1m9byas.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.
-----

The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.

To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions.  If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.
-----
*** 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
    --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/nmacaule/.rvm/rubies/ruby-2.2.0/bin/$(RUBY_BASE_NAME)
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build

extconf failed, exit code 1

Gem files will remain installed in /Users/nmacaule/.rvm/gems/ruby-2.2.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Users/nmacaule/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-13/2.2.0/nokogiri-1.6.6.2/gem_make.out
运行以下命令:

xcode-select --install

尝试使用自制软件,然后安装apple-gcc42Hi-Deep。谢谢你的帮助。我相信我试过了。我的机器上安装了Home brew。nmacaule-mn1:~nmacaule$brew安装wget警告:wget-1.16.1已安装。Brew版本为0.9.5。如何安装apple-gcc42?我尝试brew安装apple-gcc42,但失败了。再说一次,我对这方面还不太熟悉,所以详细的解释会很有帮助。干杯