【问题标题】:Can't find homebrew installed app找不到自制软件安装的应用程序
【发布时间】:2023-03-20 00:04:01
【问题描述】:

我刚刚在带有 Snow Lion 的新 Mac 上安装了自制软件。 Mac 已经在 /usr/bin/git 中安装了 git(大概是我安装 Xcode 命令行工具的时候)。

反正我跑了:

$ brew install git

命令似乎运行成功,在安装git:

/usr/local/Cellar/git/1.8.1.5/bin/git

但在终端,我得到的是旧的 git,而不是 homebew git:

$ which git
/usr/bin/git

我错过了什么?我需要在我的 PATH 之前添加 /usr/local/Cellar/git/1.8.1.5/bin 吗?谢谢。

【问题讨论】:

    标签: git homebrew


    【解决方案1】:

    酿造医生来救援:

    $ brew doctor
    Warning: /usr/bin occurs before /usr/local/bin
    This means that system-provided programs will be used instead of those
    provided by Homebrew. The following tools exist at both paths:
    
        git
        git-cvsserver
        git-receive-pack
        git-shell
        git-upload-archive
        git-upload-pack
    
    Consider amending your PATH so that /usr/local/bin
    occurs before /usr/bin in your PATH.
    

    【讨论】:

      【解决方案2】:

      当您在终端中键入命令时,它会在名为 PATH 的变量中查找它。您需要在 PATH 中的所有其他目录之前放置 Homebrew 将符号链接放置到实际可执行文件的目录。运行这个命令:

      echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
      

      然后重启你的终端。

      【讨论】:

        猜你喜欢
        • 2020-10-02
        • 2014-05-14
        • 1970-01-01
        • 2023-01-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-03-30
        相关资源
        最近更新 更多