在Mac OS 10.12上安装brew会导致xcode许可协议错误

时间:2016-10-12 12:40:59

标签: xcode macos homebrew

我正在尝试使用以下命令在Mac 10.12上安装Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

在运行时,我收到错误:

You have not agreed to the Xcode license.
Before running the installer again please agree to the license by opening
Xcode.app or running:
    sudo xcodebuild -license

所以我运行sudo xcodebuild -license命令然后再次出现另一个错误:

dyld: Library not loaded: @rpath/DVTFoundation.framework/Versions/A/DVTFoundation
  Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
  Reason: no suitable image found.  Did find:
    /Applications/Xcode.app/Contents/Developer/usr/bin/../../../SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation: cannot load '/Applications/Xcode.app/Contents/Developer/usr/bin/../../../SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation' because Objective-C garbage collection is not supported
Please review and agree to the software license agreements!

我也调查了这个错误,但没有运气。在研究这个时,我尝试使用以下命令重新安装xcode:

xcode-select --install

然后我通过以下方式检查xcode安装:

/usr/bin/xcode-select -print-path

印刷的路径似乎是正确的:

/Applications/Xcode.app/Contents/Developer

现在可以请有人帮我接受xcode的许可协议吗?这是我被卡住而无法前进的地方。任何建议或我的纠错都是值得称道的。

1 个答案:

答案 0 :(得分:2)

如果你有OSX 10.12那么xcode版本4.4.2将无法通过终端或GUI以任何方式使用它。首先尝试使用兼容版本更新您的xcode。 OSX 10.11及更高版本将支持Xcode 8。