brew: /usr/bin occurs before /usr/local/bin

ⅰ亾dé卋堺 提交于 2019-12-11 03:05:30

问题


As subject says, running

brew doctor

responds with following warnings:

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.

However, when I echo PATH, it shows /usr/local/bin as being before /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

I'm running ZSH, iTerm on Mac OS X (Yosemite). Gut feeling is that these warnings aren't really important to me, but the OCD part of me wants to get rid of all warnings....

UPDATE: Francisco below had the right idea. Turns out, I think it was an iTerm issue. I found the following while researching another issue I was looking for. So, I just changed the default profile's command from "Login shell" to:

/bin/bash -c /bin/zsh

And its all happy.


回答1:


My best guess is that your PATH settings are dependent on whether your shell is running interactively or non-interactively?

Try running both:

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

and see if the output differs. Brew is likely reporting on your non-interactive path.



来源:https://stackoverflow.com/questions/26507037/brew-usr-bin-occurs-before-usr-local-bin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!