【发布时间】:2015-02-17 02:07:41
【问题描述】:
我正在尝试安装 cocoapods,但它总是在“设置 CocoaPods 主存储库”时失败,错误代码如下:
[!] /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master --depth=1
sh: line 1: 8018 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH
我已经尝试了 StackOverFlow 上的所有建议,例如卸载并重新安装 cocoapods 或 rm -fr ~/.cocoapods/repos/master 但它仍然失败。 我在 Yosemite 10.10 上使用 xCode 6.1.1 和最新的命令行工具
【问题讨论】:
-
你的机器上安装了“git”吗?在终端中输入“git”,看看它是否有效?也可以尝试“which git”来查看 git 的路径安装。
-
@gagarwal 当我在终端中键入“git”时,它给了我与问题 sh 中相同的错误:第 1 行:842 中止陷阱:6 /Applications/Xcode.app/Contents/Developer/usr /bin/xcodebuild -sdk / -find git 2> /dev/null git: 错误:无法找到实用程序“git”,不是开发人员工具或 PATH 但是当我尝试“which git”时,它给了我路径:/ usr/bin/git
-
尝试运行“xcode-select --install”来修复开发者工具。
-
我的情况与 OP 相同,“sudo xcode-select --install”告诉我:“xcode-select:错误:命令行工具已安装,请使用“软件更新”安装更新”。显然没有应用任何修复。