brew:/ usr / bin发生在/ usr / local / bin之前

时间:2014-10-22 12:03:03

标签: macos homebrew zsh

正如主题所说,正在运行

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: ... Warning: Homebrew's bin was not found in your PATH. .... Warning: Homebrew's sbin was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin.

然而,当我回显PATH时,它显示/ usr / local / bin在/ usr / bin之前

/Users/bryce/.nvm/v0.10.32/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/bryce/bin:/Users/bryce/.rbenv/bin:/Users/bryce/.rbenv/shims:/Users/bryce/opt/Sencha/Cmd/4.0.0.203:/Users/bryce/Development/tools/apache-maven-3.1.1/bin:/opt/X11/bin:/usr/local/git/bin:/Users/bryce/.homesick/repos/bzdots/custom/bin

我在Mac OS X(Yosemite)上运行ZSH,iTerm。直觉是这些警告对我来说并不重要,但我的OCD部分想要摆脱所有警告......

更新: 弗朗西斯科下面有正确的想法。事实证明,我认为这是一个iTerm问题。在研究我正在寻找的另一个问题时,我发现了the following。所以,我只是将默认配置文件的命令从“登录shell”更改为:

/bin/bash -c /bin/zsh

这一切都很开心。

1 个答案:

答案 0 :(得分:2)

我最好的猜测是,您的PATH设置取决于您的shell是以交互方式还是以非交互方式运行?

尝试同时运行:

zsh -i -c "echo \$PATH"
zsh -c "echo \$PATH"

并查看输出是否不同。 Brew可能会报告您的非交互式路径。