2014-01-24 133 views
5

我正在尝试更新红宝石版本。 我与红宝石1.8.7,我想安装2.1.0。 我刚安装了rvm,rbenv,brew和宝石。更新MAC上的红宝石版本

但是,当我尝试做

$ rbenv install 2.1.0. 

我得到铛错误。我没有得到铿锵和红宝石之间的点

你能帮我吗?

错误:

$ rbenv install 2.1.0 
Downloading ruby-2.1.0.tar.gz... 
Installing ruby-2.1.0... 

BUILD FAILED 
... 
Last 10 log lines: 
... 
checking build system type... x86_64-apple-darwin12.3.0 
checking host system type... x86_64-apple-darwin12.3.0 
checking target system type... x86_64-apple-darwin12.3.0 
checking for gcc-4.2... no 
checking for clang... no 
checking for gcc... no 
checking for cc... no 
./configure: line 3390: -E: command not found 
configure: error: clang version 3.0 or later is required 
+0

Ruby的核心库(字符串,整数等)是在C中构建的,因此CLANG。你在什么操作系统版本的OSX?它抱怨旧CLANG版本。你有没有尝试通过'rvm'来安装? –

+0

我在OSX 10.8.3 – Medmax

+0

我试过用rvm。我收到有关我的Xcode版本的错误。它在我更新我的xcode版本后有效。谢谢。 xcode et ruby​​之间有任何联系吗? – Medmax

回答

8

你需要为了建立Ruby来安装开发工具的命令行工具。作为一种选择,您可以从App Store安装Xcode,如果它们没有随您的版本自动安装,Xcode将允许您安装命令行工具。

+6

'brew doctor'应告诉您如何执行此操作。 –

+2

'xcode-select --install' –

+0

我有同样的问题,并按照建议。我仍然得到错误: 配置:错误:C编译器无法创建可执行文件 Brew Doctor不提供帮助,xcode-select --install说:xcode-select:error:命令行工具已安装,请使用“Software更新“来安装更新 – kslstn