使用rbenv安装ruby的麻烦

时间:2014-08-25 08:14:12

标签: ruby

我只是不知道该怎么做,我尝试使用rbenv安装ruby,这就是我得到的

Nabils-MacBook-Pro:~ nabil$ rbenv install 2.0.0-p247
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
Installing yaml-0.1.6...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/0b/06_fg2050hd71mhwvfnzd6wh0000gn/T/ruby-build.20140825020354.5714
Results logged to /var/folders/0b/06_fg2050hd71mhwvfnzd6wh0000gn/T/ruby-build.20140825020354.5714.log

最后10个日志行:

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... gcc
checking whether the C compiler works... no
configure: error: in `/var/folders/0b/06_fg2050hd71mhwvfnzd6wh0000gn/T/ruby-build.20140825020354.5714/yaml-0.1.6':
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/0b/06_fg2050hd71mhwvfnzd6wh0000gn/T/ruby-build.20140825020354.5714
Results logged to /var/folders/0b/06_fg2050hd71mhwvfnzd6wh0000gn/T/ruby-build.20140825020354.5714.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... gcc
checking whether the C compiler works... no
configure: error: in `/var/folders/0b/06_fg2050hd71mhwvfnzd6wh0000gn/T/ruby-build.20140825020354.5714/yaml-0.1.6':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

1 个答案:

答案 0 :(得分:1)

您需要安装XCode命令行工具才能正确使用rbenv。您可以按照this guide将其安装在您的XCode和OS X版本上。