安装ruby时出现问题

安装ruby时出现问题,ruby,Ruby,我在尝试安装ruby时得到以下响应。由于我是这项技术的新手,我正在努力解决它。任何帮助都将不胜感激。提前谢谢 Downloading yaml-0.1.4.tar.gz... -> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b Installing yaml-0.1.4... BUILD FAILED Inspect or clean up the working tree at /var

我在尝试安装ruby时得到以下响应。由于我是这项技术的新手,我正在努力解决它。任何帮助都将不胜感激。提前谢谢

Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...

BUILD FAILED

Inspect or clean up the working tree at    /var/folders/tn/plvd9hsd2cz5b07805zxdzf40000gp/T/ruby-build.20131224182655.29784
Results logged to /var/folders/tn/plvd9hsd2cz5b07805zxdzf40000gp/T/ruby-build.20131224182655.29784.log

Last 10 log lines:
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... /usr/local/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/var/folders/tn/plvd9hsd2cz5b07805zxdzf40000gp/T/ruby-build.20131224182655.29784/yaml-0.1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details

BUILD FAILED

Inspect or clean up the working tree at /var/folders/tn/plvd9hsd2cz5b07805zxdzf40000gp/T/ruby-build.20131224182655.29784
Results logged to /var/folders/tn/plvd9hsd2cz5b07805zxdzf40000gp/T/ruby-build.20131224182655.29784.log

Last 10 log lines:
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... /usr/local/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/var/folders/tn/plvd9hsd2cz5b07805zxdzf40000gp/T/ruby-    build.20131224182655.29784/yaml-0.1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

无法从这些信息中真正理解。尝试查看config.log。 如果您是第一次安装,请尝试使用rbenv。按照以下步骤安装Ruby 2.0:

git克隆git://github.com/sstephenson/rbenv.git rbenv先生 echo'export PATH=$HOME/.rbenv/bin:$PATH'>>~/.bash\u配置文件 echo“eval$rbenv init-”>~/.bash\u配置文件 git克隆git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby build source~/.bash_配置文件 rbenv安装2.0.0-p247 rbenv全球2.0.0-p247 rbenv再灰烬 ruby-v这是为了检查ruby是否已安装 gem安装绑定器
从头开始:您使用了什么安装说明?您首先键入了什么?可能是损坏的gcc安装。您在config.log文件中看到了吗?您是否尝试过从软件包中安装它?卸载用sudomakeinstall安装的东西是一项相当棘手的任务。这要简单得多。