Xcode - 配置:错误:在$ PATH中找不到可接受的C编译器

时间:2012-02-17 05:54:55

标签: ruby xcode gcc compiler-errors rvm

从头开始重建mac。安装了xcode和rvm然后尝试安装红宝石,但他们都给了我:

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吗?我该如何安装?

4 个答案:

答案 0 :(得分:176)

关键步骤实际上安装 Xcode命令行工具 下载完成后安装Xcode

从应用程序商店下载并安装Xcode后,您需要实际安装它提供的命令行工具 要做到这一点,打开Xcode,转到首选项然后下载。有一个“安装”链接来添加命令行工具。

完成此操作后,请务必重新打开终端窗口。

答案 1 :(得分:10)

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

安装完毕后,您可以继续使用rvm安装红宝石。

答案 2 :(得分:2)

rbenv安装错误:

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

......把我带到了这里,

我目前正在使用全新的Debian安装Ruby on rails,ruby通过rbenv,

原始命令是:

rbenv install 2.0.0-p0  

作为解决方案:

sudo apt-get install build-essential

干杯!

[抱歉Xcode ppl]

答案 3 :(得分:0)

阅读rvm requirements它显示了编译ruby所需的内容。

相关问题