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

Mic*_*ant 63 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$ 
Run Code Online (Sandbox Code Playgroud)

日志有:

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
Run Code Online (Sandbox Code Playgroud)

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

Cra*_*ott 176

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

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

完成后,请务必重新打开终端窗口.

  • +1用于添加有关安装Xcode命令行工具的信息 (9认同)

thr*_*ree 10

要么从App商店安装Xcode,要么你有一个注册的免费开发者帐户,你可以从http://developer.apple.com/downloads下载XCode命令行工具.

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