0

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:
/usr/local/sbin

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.

5
  • Can we assume $PATH does actually contain /usr/local/sbin and when you reboot and open a new terminal window?
    – bmike
    Dec 27, 2012 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
    – 0xDonut
    Dec 27, 2012 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, 2012 at 4:25
  • I'm using the standard shell via terminal.
    – 0xDonut
    Dec 27, 2012 at 12:29
  • See apple.stackexchange.com/questions/69223/… for another way
    – mmmmmm
    Sep 25, 2013 at 18:37

3 Answers 3

2

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

4
  • 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?
    – 0xDonut
    Dec 27, 2012 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, 2012 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, 2012 at 14:39
  • I edited ~/.bash_profile and restarted, finally it all seems to be working. thanks!
    – 0xDonut
    Dec 27, 2012 at 23:16
2

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
0

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

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

And then use the $PATH which makes RVM happy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .