使用rbenv安装ruby的问题

使用rbenv安装ruby的问题,ruby,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.

我只是不知道该怎么做,我试着用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.

您需要安装XCode命令行工具才能正确使用rbenv。您可以按照以下步骤在您的XCode和OS X版本上安装它