2014-10-22 40 views
2

作主语说发生时,运行BREW:在/ usr/bin中之前在/ usr/local/bin目录

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 

而它的所有开心。

+0

您可以在'/ usr/local/Library/Homebrew/cmd/doctor.rb'函数'check_user_path_1'中调试一些调试输出以检查它的想法。 – 2014-11-14 16:17:30

回答

1

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

尝试同时运行:

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

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