为什么 RVM 在安装 XCode 后找不到编译器和“make”工具?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17006304/
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-15 03:28:10  来源:igfitidea点击:

Why can't RVM find compiler and 'make' tool after installing XCode?

iosrubyxcodemacos

提问by WowBow

I installed RVM on OS X 10.8.3. The command rvm -vworks but there was one error when I tried to execute the following code:

我在 OS X 10.8.3 上安装了 RVM。该命令rvm -v有效,但是当我尝试执行以下代码时出现一个错误:

\curl -L https://get.rvm.io | bash -s stable --rails # Or, --ruby=2.0.0-p195

Here is the error:

这是错误:

rvm 1.20.13 (stable) by Wayne E. Seguin , Michal Papis  [https://rvm.io/]

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-2.0.0-p195.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.

    Can not find compiler and 'make' tool - make sure Xcode and/or Command Line Tools are installed.

I even tried rvm install 1.9.2but the same error showed up. I also installed Xcode with no luck.

我什至尝试过, rvm install 1.9.2但出现了同样的错误。我也没有运气安装了Xcode。

回答by Simon M

It looks like you have installed Xcode, but not the command line tools that RVM requires to build Ruby and other components (make, gcc, etc)

看起来你已经安装了Xcode的,但没有在命令行工具,RVM需要建立Ruby和其它组件(makegcc,等)

Here are some instructions (taken from this answer):

以下是一些说明(取自此答案):

Xcode includes a new "Downloads" preference pane to install optional components such as command line tools, and previous iOS Simulators. To open this pane click the "Xcode" button in the top left of the screen near the Apple logo, then click "Preferences", then click "Downloads".

screenshot of downloads pane

Xcode 包含一个新的“下载”首选项窗格,用于安装可选组件,例如命令行工具和以前的 iOS 模拟器。要打开此窗格,请单击屏幕左上角 Apple 徽标附近的“Xcode”按钮,然后单击“首选项”,然后单击“下载”。

下载窗格的屏幕截图

Then install the 'Command Line Tools' bundle by clicking the Installbutton to the right of it.

然后单击Install右侧的按钮安装“命令行工具”包。

回答by Dan Rosenstark

For Xcode 5 it's

对于 Xcode 5,它是

Xcode -> Preferences -> Download -> Command Line Tools

Xcode -> Preferences -> Download -> Command Line Tools