【发布时间】:2015-08-27 04:09:59
【问题描述】:
我想在我的 Mac(OS X 10.10.3) 上安装 git。我写:brew install git
但它报告了:
sh: line 1: 1549 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find clang 2> /dev/null
clang: error: unable to find utility "clang", not a developer tool or in PATH
sh: line 1: 1552 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find otool 2> /dev/null
otool: error: unable to find utility "otool", not a developer tool or in PATH
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool
然后我写 brew doctor。它报告:
Warning: /usr/local/include isn't writable.
This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.
You should probably `chown` /usr/local/include
Warning: /usr/local/lib isn't writable.
This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.
You should probably `chown` /usr/local/lib
sh: line 1: 1318 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find otool 2> /dev/null
otool: error: unable to find utility "otool", not a developer tool or in PATH
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool
然后我 chown 库并包含“sudo chown 755 include”“sudo chown 755 lib” 第一个和第二个警告被删除,但第三个仍然存在。
更让我困惑的是,在我的 finder:/usr/local/ 中,“include”和“lib”应该是文件夹,但变成了文件。 如何解决“找不到 otool”错误并使用 brew 和
安装 git为什么我的 lib 和 include 文件夹变成了文件?...感谢您的帮助!
【问题讨论】:
-
这应该是问题跟踪器上的错误报告。
-
你的 Xcode 环境坏了。如果 /usr/bin/clang 丢失,你应该重新安装 OS X。如果它存在,你应该确保
xcode-select -p指向开发者路径。否则,您应该重新安装 Xcode 或 Xcode 命令行工具。 -
@TimSmith 感谢您的帮助。在 /usr/bin/clang 中仍然存在。 'xcode-select -p' 指向 /Applications/Xcode.app/Contents/Developer。我不明白为什么我的两个文件夹变成了文件。这令人困惑。因为我在我的 xcode 中运行程序没有问题。有人建议重新安装自制软件。我不知道该怎么办?你能解释一下吗?
-
@NickVolynkin 抱歉,我是 Mac 新手。对我应该怎么做有什么建议吗?
-
@Shawn 我指的是 GitHub 上的 Homebrew 问题跟踪器。但由于 Tim Smith 是 Homebrew 维护者,因此没有必要这样做。