【问题标题】:Xcode - configure: error: no acceptable C compiler found in $PATHXcode - 配置:错误:在 $PATH 中找不到可接受的 C 编译器
【发布时间】:2012-03-08 13:53:49
【问题描述】:

从头开始重建 Mac。安装了 xcode 和 rvm 然后尝试安装 rubies 但它们都给了我:

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 编译器吗?如何安装?

【问题讨论】:

标签: ruby xcode gcc compiler-errors rvm


【解决方案1】:

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

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

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

【讨论】:

  • +1 用于添加有关安装 Xcode 命令行工具的信息
  • 精彩的评论,为我节省了大量时间。
  • 没有看到这个答案我怎么知道???感谢您指出了这一点!顺便说一句,我的工作无需重新打开我的终端窗口。
  • 在找到这个答案之前,我已经苦苦挣扎了两天。 +1 指出 Xcode CL 工具。我现在可以安装和使用 Xdebug
【解决方案2】:

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

一旦你安装好了,你就可以继续用 rvm 安装你的 rubies。

【讨论】:

  • 需要4.x以上的XCode版本。
【解决方案3】:

rbenv 安装错误:

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

...带我来这里,

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

原来的命令是:

rbenv install 2.0.0-p0  

作为解决方案:

sudo apt-get install build-essential

干杯!

[对不起 Xcode ppl]

【讨论】:

    【解决方案4】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-14
      • 1970-01-01
      • 2016-06-08
      • 1970-01-01
      • 2011-01-14
      • 2013-11-17
      • 2018-12-11
      • 1970-01-01
      相关资源
      最近更新 更多