brew doctor complains about paths in .bashrc #8791

mxa opened this Issue Nov 25, 2011 · 13 comments


None yet

7 participants

mxa commented Nov 25, 2011

==> /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. This is an issue if you eg. brew installed Python.

Consider editing your .bashrc to put:
ahead of /usr/bin in your $PATH.

that's on a fresh homebrew installation. why doesn't the installer take care of that?

now my .bashrc file looks like this:
but the error in brew doctor still persists.

Sharpie commented Nov 25, 2011

We don't alter the user's PATH. Ever.

@Sharpie Sharpie closed this Nov 25, 2011

The Homebrew installer (and more generally, Homebrew itself) will not touch files outside of its installation. It is up to you to make the necessary adjustments to your configuration files.

In this case, brew doctor will continue to warn you because /usr/local/bin is not first in your PATH. The warning will cease if you adjust it to something like PATH=/usr/local/bin:${PATH}.

mxa commented Nov 25, 2011

now my .bashrc reads:
and i'm still getting the error.


That PATH statement includes only /usr/local/bin; it would be good to instead add export PATH=/usr/local/bin:/usr/local/sbin:$PATH

mxa commented Nov 26, 2011

ok, thanks. both .bashrc and .bash_profile now read
export PATH=/usr/local/bin:/usr/local/sbin:$PATH

i'm getting errors like
-bash: chown: command not found
seems i messed up my system now. what do i have to change in .bashrc and .bash_profile to fix this?


Sorry, should have been clearer.

Remove the first PATH= line. The reason I have $PATH last in the line I gave you is because it lets you keep all of the default system paths - just after the other paths you want to put in front. As long as you don't have another definition of PATH coming first in your .bash_profile, then $PATH in that line will be the default system path. If you want ~/bin in addition to the other paths, use just this one line:

export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH

Make sure you don't have another PATH= or export PATH= line before it.

(The reason it couldn't find chown is because that's in /usr/sbin, one of the lines you were missing in your PATH definitions. The default PATH contains /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin)

mxa commented Nov 26, 2011

ah ok thanks for explaining this.
.bash_profile now reads:
[[ -s ~/.bashrc ]] && source /.bashrc
and .bashrc like this:
export PATH=/usr/local/bin:/usr/local/sbin:

echo $PATH gives me

chown and friends are now working again.


The error can really be cleaned up so that it is more user friendly....


mxa's solution worked great. The doctor's message should be clearer that .bashrc isn't necessarily the problem (it even throws up this error in zsh for me)


Is it a good idea to move /usr/local/bin up in /etc/paths? Thanks


No, I'd recommend doing it in your bashrc (or equivalent).


And if it's Apache running Django/Python?


@thie1210 You should just be able to set it in the .profile of the user account Apache is running as.

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.