安装ruby时出问题

时间:2013-12-24 13:14:22

标签: 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/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.

1 个答案:

答案 0 :(得分:0)

无法从这些信息中找到答案。尝试查看 config.log
如果您是第一次安装,请尝试使用rbenv。按照步骤安装Ruby 2.0:

  1. git clone git://github.com/sstephenson/rbenv.git .rbenv
  2. echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
  3. echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
  4. git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  5. source ~/.bash_profile
  6. rbenv install 2.0.0-p247
  7. rbenv global 2.0.0-p247
  8. rbenv rehash
  9. ruby -v #This is to check whether Ruby got installed or not
  10. gem install bundler