Xcode – configure:error:在$ PATH中找不到可接受的C编译器

从头开始重build一个mac。 安装xcode和rvm,然后尝试安装ruby,但他们都给我:

Error running ' ./configure --prefix=/Users/durrantm/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/durrantm/.rvm/usr ', please read /Users/durrantm/.rvm/log/ruby-1.9.3-p125/configure.log There has been an error while running configure. Halting the installation. Michaels-MacBook-Air:~ durrantm$ 

日志有:

 checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/Users/durrantm/.rvm/src/ruby-1.9.2-p290': configure: error: no acceptable C compiler found in $PATH 

我需要gcc C compliler吗? 我如何安装?

关键的一步是在下载完成 安装 Xcode命令行工具

在从app store下载并安装Xcode之后,您需要实际安装它提供的命令行工具。
要做到这一点打开Xcode,去偏好,然后下载。 有一个“安装”链接来添加命令行工具。

一旦完成,请确保重新打开terminal窗口。

您可以从App Store安装Xcode,或者如果您有注册的免费开发者帐户,则可以从http://developer.apple.com/downloads下载XCode命令行工具;

一旦你安装了,你可以继续安装你的rubyrvm。

rbenv安装错误:

 configure: error: in `/tmp/ruby-build.20130911002344.31969/ruby-2.0.0-p0': configure: error: no acceptable C compiler found in $PATH 

…带我到这,

我目前在rails上安装Ruby,通过rbenv在一个全新的Debian上进行ruby,

原始命令是:

 rbenv install 2.0.0-p0 

作为解决scheme:

 sudo apt-get install build-essential 

干杯!

[对不起,Xcode的人]

阅读rvm requirements它显示了你需要编译ruby。