我使用自制软件时会遇到麻烦

Sha*_*awn 11 git homebrew include

我想在我的Mac上安装git(OS X 10.10.3).我写道: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
Run Code Online (Sandbox Code Playgroud)

然后我写brew医生.它报告说:

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
Run Code Online (Sandbox Code Playgroud)

然后我chown lib并包括"sudo chown 755 include""sudo chown 755 lib"第一个和第二个警告被删除但第三个仍然存在.

令我困惑的是,在我的查找器中:/ usr/local /"include"和"lib"应该是文件夹但是成为文件.我怎么能解决错误"找不到otool"并用brew安装git

为什么我的lib和include文件夹成为文件?...感谢您的帮助!

Iva*_*Mir 50

问题是Xcode由于某些原因无法找到自己的命令行工具:

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
Run Code Online (Sandbox Code Playgroud)

xcode-select --print-path在您的航站楼退房.

如果/Applications/Xcode.app/Contents/Developer然后运行sudo xcode-select --switch /Library/Developer/CommandLineTools将xcode-select设置为非Xcode命令行工具.

如果您没有/Library/Developer/CommandLineTools目录,可以通过https://developer.apple.com/downloads/获取当前的Xcode版本.

  • 像魅力一样工作!TY (2认同)