brew:/usr/bin出现在/usr/local/bin之前 [英] brew: /usr/bin occurs before /usr/local/bin

查看:168
本文介绍了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.

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之前

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

我正在Mac OS X(Yosemite)上运行iSH ZSH.胆量是这些警告对我来说并不是很重要,但是我的强迫症部分想摆脱所有警告....

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....

更新: 下面的弗朗西斯科有一个正确的主意.原来,我认为这是一个iTerm问题.我发现

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

很高兴.

推荐答案

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

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

尝试同时运行:

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

,然后查看输出是否不同. Brew可能会报告您的非交互式路径.

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

这篇关于brew:/usr/bin出现在/usr/local/bin之前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆