Search code examples
macoshomebrewzshzshrc

Homebrew keep showing warning to set PATH on OS X 10.11


I am on Mac OSX 10.11 after running

brew doctor

And there is a warning in my terminal.

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

After I fixed this PATH in my .zshrc file, I run brew doctor again, this error is still remain.

Any suggestions?


Solution

  • What my .zshrc file now looks like:

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

    I finally solved this problem by restarting my terminal and run brew doctor again. Warnings disappear!