错误消息 "Xcode alone is not sufficient on Sierra"

Error Message "Xcode alone is not sufficient on Sierra"

我想安装 openCV 来矢量化图像,但是有一系列关于 Xcode 和 Ruby 的错误消息。

首先,我使用终端安装openCV,brew install opencv

然后,我收到错误消息,指出系统不喜欢我的 ruby 版本。

/usr/local/Homebrew/Library/Homebrew/brew.rb:12:in `<main>': 
Homebrew must be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)

所以,我想升级我的 ruby。我遵循了 post 的几个更新策略。首次 ruby 升级试用:brew link --overwrite ruby & brew unlink ruby && brew link ruby 并获得

Error: No such keg: /usr/local/Cellar/ruby

然后第二次 ruby 升级试验:brew upgrade ruby 并看到以下错误消息。

Error: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
xcode-select --install 

此错误消息意味着我需要安装我已经安装的 Xcode。所以,我用 code-select -p 检查我的 Xcode 状态并得到 /Applications/Xcode.app/Contents/Developer,这意味着我很好。

我看到 comment 关于安装位置 python 可能是个大问题。引用来源:

If you see /usr/local/bin/python3 then you are correctly using the Homebrew version of Python. If the output is instead /usr/bin/python3 then you are incorrectly using the system version of Python.

我检查 which python3 并得到

/Users/******/anaconda3/bin/python3

这可能是问题所在吗?如何将系统版本更改为本地?

让我自己解释一下,这样人们就不会犯同样的错误了。

当我看到错误信息的最后一行时

Error: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
xcode-select --install 

我的想法是:我已经Xcode为什么系统要我"reinstall"了。但是,感谢@SamiKuhmonen @Beartech @patrick kuang 的建议,我搜索了一个page(普通话)。 xcode-select --install 不重装整个 Xcode。这意味着安装一些缺少的命令行工具,这是安装 Ruby.

所必需的

尽管 Xcode 并且命令行工具已经 installed a long time ago 并且更新了无数次,但我还是收到了相同的消息。

我认为这是 Apple 告诉您 Xcode 命令行工具需要更新的方式,因为 App Store 向我展示了以下内容:

执行xcode-select --install命令后,更新从App Store中消失,这意味着它们是完全一样的东西。

尝试通过 brew 安装 k8s 包,我刚才在终端中遇到了同样的问题:

Error: Xcode alone is not sufficient on Sierra.

Install the Command

Line Tools: xcode-select --install

您需要下载*.dmg个文件; Command Line Tools (macOS x.x.x) for XCode N 。在这里搜索:https://developer.apple.com/download/more/。您必须拥有开发者帐户。

那么,恭喜!

2019 年更新

macOS 莫哈韦沙漠 10.14.5

对 macOS 10.14 使用 Xcode10.2

我在 Sierra 上的 Macbook Pro 上遇到了同样的问题。除了从 App Store 更新 Xcode 之外,我还使用 xcode-select --install 命令安装了命令行实用程序。

更新步骤后,brew 命令开始正常工作。我也在这段时间更新了我的OS。

我遇到了同样的问题。我从 https://developer.apple.com/download/more/ 安装了 'Command Line Tools for XCode'(选择合适的版本)并重新启动了我的终端。问题已解决:)