gpt4 book ai didi

git - OS X 10.10 : Errors in locating and using brew and Git

转载 作者:太空狗 更新时间:2023-10-29 14:25:08 24 4
gpt4 key购买 nike

我上次使用 brew 和 Git 是几周前的事,一切都运行良好。但是,现在,当我在终端中键入 git --version 时,我得到了

git: error: unable to find utility "git", not a developer tool or in PATH. 

虽然我的/usr/local 目录中确实有一个 Git 文件夹......

如果我尝试 brew update,我会得到完全相同的错误,加上

Error: Failure while executing: git init. 

brew install git 结果:

clang: error: unable to find utility "clang", not a developer tool or in PATH
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

显然,我的 Git(和 brew?)安装或至少它的路径出现了严重错误。

如果我通过输入手动提供路径

export PATH=/usr/local/git/bin:$PATH

在终端中询问我的 Git 版本,我得到正确的输出:

git version 2.3.5

谁能告诉我这里出了什么问题,或者我该如何修复 Git 和 brew 的路径以便再次工作?

最佳答案

天哪,我想通了!两周前我做了一件事:我安装了 Python 3.4 并卸载了 OS X 预装的 Python 2.7。现在我发现 Python 2.7 对 Xcode 至关重要,所以我干脆重新安装了它。

现在两个 Python 版本都在我的系统上,不仅 Xcode 再次毫无怨言地工作,而且 brew 也不再产生任何错误 ...

关于git - OS X 10.10 : Errors in locating and using brew and Git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29865155/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com