【问题标题】:Fixing Homebrew Warning: Directory should not end in a slash修复 Homebrew 警告:目录不应以斜杠结尾
【发布时间】:2014-05-30 20:00:09
【问题描述】:

我今天安装了 Homebrew,并按照应用程序的建议运行

brew doctor

我收到了这个警告:

Warning: Some directories in your path end in a slash.
Directories in your path should not end in a slash. This can break other
doctor checks. The following directories should be edited:
    /Users/MyUsername/

谷歌搜索后,我打开了

vi ~/.bash_profile

从终端并手动删除我的用户名后的“/”。所以现在我的 .bash_profile 看起来像这样:

export PATH=$PATH:/Users/MyUsername
export PATH=/usr/local/git/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/MyUsername

然后我重新输入提示并得到相同的警告。我该如何解决?

【问题讨论】:

    标签: installation homebrew


    【解决方案1】:

    您是否尝试重新启动终端?或者至少打开一个新会话(标签)?

    【讨论】:

      【解决方案2】:

      如果您使用的是 zsh,您还需要编辑 ~/.zshrc 文件并删除“/usr/local/bin”末尾的尾部斜杠。

      【讨论】:

      • 这对我有用;但是它是我的~/.profile 中的export PATH...,与zsh 无关
      【解决方案3】:

      编辑您的个人资料后,您必须告诉操作系统。从终端执行以下命令: 来源 ~/.bash_profile

      【讨论】:

        猜你喜欢
        • 2018-01-08
        • 1970-01-01
        • 2021-11-06
        • 2010-09-17
        • 1970-01-01
        • 2020-08-14
        • 1970-01-01
        • 2020-08-08
        相关资源
        最近更新 更多