gpt4 book ai didi

git - Homebrew:不会在 Mountain Lion 上链接 git

转载 作者:太空狗 更新时间:2023-10-29 14:39:40 26 4
gpt4 key购买 nike

已安装 Homebrew 并已下载 git,但无法链接。收到此错误消息:

Consider amending your PATH so that /usr/local/bin
occurs before /usr/bin in your PATH.
Warning: You have a non-Homebrew 'pkg-config' in your PATH:
/opt/sm/pkg/active/bin/pkg-config

`./configure` may have problems finding brew-installed packages using
this other pkg-config.
unknown7cd1c3e98b07:~ pdenlinger$ brew install git
Error: git-1.8.0 already installed, it's just not linked
unknown7cd1c3e98b07:~ pdenlinger$ brew link git
Linking /usr/local/Cellar/git/1.8.0... Warning: Could not link git. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/git/1.8.0/bin/gitk
Target /usr/local/bin/gitk already exists. You may need to delete it.
To force the link and delete this file, do:
brew link --overwrite formula_name

To list all files that would be deleted:
brew link --overwrite --dry-run formula_name
unknown7cd1c3e98b07:~ pdenlinger$ brew link git

我该怎么做才能解决这个问题?

vi 命令的响应:

sudo vi /etc/paths     /usr/local/bin  /usr/local/sbin   /usr/bin   /bin   /usr/sbin   /sbin
7 files to edit


E325: ATTENTION
Found a swap file by the name "/etc/.paths.swp"
owned by: root dated: Thu Nov 22 09:10:09 2012
file name: /private/etc/paths
modified: no
user name: root host name: unknown7cd1c3e98b07.att.net
process ID: 98069 (still running)
While opening file "/etc/paths"
dated: Tue Aug 21 15:44:10 2012

(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.

(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/paths"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/.paths.swp"
to avoid this message.

Swap file "/etc/.paths.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

最佳答案

Possible duplicate of this question ... 解决方案是

打开/etc/paths 文件,将/usr/local/bin 放在/usr/bin 之上

$ sudo vi /etc/paths
/usr/local/bin
/usr/local/sbin
/usr/bin
/bin
/usr/sbin
/sbin

关于git - Homebrew:不会在 Mountain Lion 上链接 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13517286/

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