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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9323612/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 04:46:27  来源:igfitidea点击:

Xcode - configure: error: no acceptable C compiler found in $PATH

rubyxcodegcccompiler-errorsrvm

提问by Michael Durrant

rebuilding a mac from scratch. Installed xcode and rvm then trying to install rubies but they are all giving me:

从头开始重建 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$ 

The log has:

日志有:

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

Do I need the gcc C compliler? How do I install it ?

我需要 gcc C 编译器吗?我该如何安装?

回答by Craig Ulliott

The critical step is actually installingthe Xcode command line toolsafterthe download completes andXcode is installed

关键的一步是实际安装Xcode的命令行工具下载完成,并已安装的Xcode

After downloading and installing Xcode from the app store, you need to actually install the command line tools it provides.
To do this open Xcode, go to preferences then downloads. There is an "Install" link to add the command line tools.

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

Once this has been completed, make sure to re-open your terminal window.

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

回答by three

Either you install Xcode from the App store or if you have a registered free developer account you can download the XCode command line tools from http://developer.apple.com/downloads

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

Once you have that installed you can go ahead and install your rubies with rvm.

安装完成后,您可以继续使用 rvm 安装您的 rubies。

回答by Steven Luong C

rbenv install error :

rbenv 安装错误:

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

...brought me here,

...带我到这,

I am currently installing Ruby on rails, ruby through rbenv on a brand new Debian,

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

Original command is :

原始命令是:

rbenv install 2.0.0-p0  

As a solution :

作为解决方案:

sudo apt-get install build-essential

Cheers !

干杯!

[Sorry for the Xcode ppl]

[对不起 Xcode ppl]

回答by mpapis

Read rvm requirementsit shows what you need to compile ruby.

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