Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to install Yeoman.io and part of it requires Homebrew to be installed. I am on Mountain Lion (10.8) and things seemed to install correctly except when I run $ homebrew doctor it complains with the following message:

Warning: Homebrew's sbin was not found in your path.
Consider amending your PATH variable so it contains:

Here is what my ~/.bashrc looks like:

#PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
setenv PATH=/usr/bin:/usr/local/bin:/opt/local/sbin:$HOME/.rvm/bin:$PATH

and my .bash_profile looks like:

[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

I use RVM so it's written in its own stuff in case that affects the homebrew installation.

share|improve this question
Can we assume $PATH does actually contain /usr/local/sbin and when you reboot and open a new terminal window? –  bmike Dec 27 '12 at 0:50
when I run echo $PATH I get the following output: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/fazal/.rvm/bin –  Demwunz Dec 27 '12 at 2:41
Last question about e question? Did you choose a shell other than bash (the default shell on OS X?) –  bmike Dec 27 '12 at 4:25
I'm using the standard shell via terminal. –  Demwunz Dec 27 '12 at 12:29
See apple.stackexchange.com/questions/69223/… for another way –  Mark Sep 25 '13 at 18:37

3 Answers 3

up vote 2 down vote accepted

Your path (as shown) doesn't contain /usr/local/sbin. Add that in the line where you set the path. Also, bash doesn't use setenv; just use PATH=....

share|improve this answer
I've edited ~/.bashsrc to look like: PATH=$PATH:/usr/local/sbin:$HOME/.rvm/bin however when I do echo $PATH it returns this: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/fazal/.rvm/bin is there some sort of caching issue going on? –  Demwunz Dec 27 '12 at 14:15
Did you quit the shell after making the changes? Also, you may want to make these changes in ~/.bash_profile too (if you use Terminal) –  lupincho Dec 27 '12 at 14:33
(Can't edit my previous comment). See this for the difference between bash_profile and bashrc: apple.stackexchange.com/questions/51036/… –  lupincho Dec 27 '12 at 14:39
I edited ~/.bash_profile and restarted, finally it all seems to be working. thanks! –  Demwunz Dec 27 '12 at 23:16

The OS X Terminal loads ~/.bash_profile instead of ~/.bashrc.

So it is common (and even recommended) to put your customizations into ~/.bash_profile and then source it from ~/.bashrc with:

[ -n "$PS1" ] && source ~/.bash_profile
share|improve this answer

Future Googlers, what if you've already amended your .bash_profile and one change or another makes either brew or rvm mad?

.bash_profile for a happy rvm.

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

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH=$PATH:/usr/local/bin

.bash_profile for a happy homebrew.

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

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH=/usr/local/bin:$PATH

Open up your /etc/paths in your editor so that usr/local/bin is in the top slot here's mine


And then use the $PATH which makes RVM happy.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.