用rbenv 安装ruby 2.0.0的时候出错了

【字号: 日期:2022-10-23浏览:28作者:雯心

问题描述

先安装的homebrew 然后安装的rbenv 接下来安装 ruby 2.0.0 结果编译的时候出错了。

dationtekiMacBook-Air:~ dation$ rbenv install 2.0.0-p247Downloading ruby-2.0.0-p247.tar.gz...-> http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gzInstalling ruby-2.0.0-p247...BUILD FAILEDInspect or clean up the working tree at /var/folders/bp/71f4bqx11kx43wxx8stmdmn00000gn/T/ruby-build.20130908132041.62016Results logged to /var/folders/bp/71f4bqx11kx43wxx8stmdmn00000gn/T/ruby-build.20130908132041.62016.logLast 10 log lines:checking for gcc-4.2... nochecking for clang... nochecking for gcc... nochecking for cc... nochecking for gcc... nochecking for cc... nochecking for cl.exe... noconfigure: error: in `/var/folders/bp/71f4bqx11kx43wxx8stmdmn00000gn/T/ruby-build.20130908132041.62016/ruby-2.0.0-p247’:configure: error: no acceptable C compiler found in $PATHSee `config.log’ for more detailsBUILD FAILEDInspect or clean up the working tree at /var/folders/bp/71f4bqx11kx43wxx8stmdmn00000gn/T/ruby-build.20130908132041.62016Results logged to /var/folders/bp/71f4bqx11kx43wxx8stmdmn00000gn/T/ruby-build.20130908132041.62016.logLast 10 log lines:checking for clang... nochecking for gcc... nochecking for cc... nochecking for gcc... nochecking for cc... nochecking for cl.exe... noconfigure: error: in `/var/folders/bp/71f4bqx11kx43wxx8stmdmn00000gn/T/ruby-build.20130908132041.62016/ruby-2.0.0-p247’:configure: error: no acceptable C compiler found in $PATHSee `config.log’ for more details/usr/local/bin/ruby-build: line 387: make: command not found

问题解答

回答1:

没有编译器。

安装最新的Xcode 4.6, 然后启动Xcode, 去Xcode的preference, 跳到Download tab, 下载 Command Line Tools.

回答2:

mac下建议使用rvm安装

开启autolibs就可以安装好依赖了

相关文章: