当我使用自制软件时遇到麻烦 [英] troubles when I use homebrew
问题描述
我想在我的Mac上安装git(OS X 10.10.3)。我写道:brew install git
但它报告:
sh:第1行:1549中止陷阱:6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find clang 2 - ; / dev / null
clang:错误:无法找到实用程序clang,而不是开发人员工具或路径
sh:第1行:1552中止陷阱:6 /Applications/Xcode.app/Contents/开发者/ usr / bin / xcodebuild -sdk / -find otool 2> / dev / null
otool:错误:无法找到工具otool,而不是开发工具或PATH
错误:执行失败:/ usr / bin / otool -L / usr / bin / install_name_tool
然后我写brew doctor。它报告:
警告:/ usr / local / include不可写。
如果您的sudo make install软件不是由
管理的Homebrew,就会发生这种情况。如果公式试图将文件写入此目录,则
安装将在链接步骤中失败。
您应该可能`chown` / usr / local / include
警告:/ usr / local / lib不可写。
如果您的sudo make install软件不是由
管理的Homebrew,就会发生这种情况。如果公式试图将文件写入此目录,则
安装将在链接步骤中失败。
您应该可能`chown` / usr / local / lib
sh:第1行:1318中止陷阱:6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find otool 2> / dev / null
otool:错误:无法找到工具otool,而不是开发工具或PATH
错误:执行失败:/ usr / bin / otool -L / usr / bin / install_name_tool
然后我chown lib并包含sudo chown 755 includesudo chown 755 lib
第一个和第二个警告被删除,但第三个仍然存在。
更让我困惑的是在我的发现者:/ usr / local / the include和lib应该是文件夹,但成为文件。
如何解决错误无法找到otool并将brew安装到git和
为什么我的lib和include文件夹变成了文件?...谢谢您的帮助!
问题在于Xcode无法找到自己的命令行工具:
sh:第1行:1549中止陷阱:6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / - 找到clang 2> / dev / null
clang:error:无法找到实用程序clang,而不是开发人员工具或PATH
在终端中查看 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版本。
I want to install git in my Mac(OS X 10.10.3).I write: brew install git
but it reported :
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
then I write brew doctor. it reported:
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
then I chown the lib and include with "sudo chown 755 include""sudo chown 755 lib" the first and second warning are removed but the third is still there.
And what confused me more is that in my finder:/usr/local/ the "include" and "lib" which should be folders but become files. how can I slove the error "cannot find otool" and install git with brew and
why my lib and include folder become files?... thanks for your help!
The problem is that Xcode is unable to find its own Command Line Tools for some reason:
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
Check out xcode-select --print-path
in your Terminal.
If it's /Applications/Xcode.app/Contents/Developer
then run sudo xcode-select --switch /Library/Developer/CommandLineTools
to set xcode-select to non-Xcode Command Line Tools.
In case you don't have /Library/Developer/CommandLineTools
directory, you can get them at https://developer.apple.com/downloads/ for your current Xcode version.
这篇关于当我使用自制软件时遇到麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!