ruby - Xcode - 配置 : error: no acceptable C compiler found in $PATH

标签 ruby xcode gcc compiler-errors rvm

从头开始重建 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 编译器吗?如何安装?

最佳答案

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

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

一旦完成,请确保重新打开您的终端窗口。

关于ruby - Xcode - 配置 : error: no acceptable C compiler found in $PATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9323612/

相关文章:

ruby - 如何使用 httparty 模仿 curl Action

ios - 将文本样式化到 UITextView

c++ - GCC 内部编译器错误 : Segmentation fault

ruby-on-rails - Rails docker postgres 连接被拒绝

ruby-on-rails - 安装 rails 时出错,无法构建 gem native 扩展

ruby - 在 Ruby 中解析大文件的最快方法

iphone - 检查 iphone 进程之间的 Internet 连接

iOS-Universal-Framework安装问题

c - 海湾合作委员会:__attribute__((malloc))

c++ - gcc 的任何标签来编译包含 C 3rd 方头文件的 Cpp 文件