ruby - update - uninstall homebrew
How to modify PATH for Homebrew? (4)
Trying to install ruby 1.9.3, read that I need to install homebrew first. Ran brew doctor, and it's giving me a bunch of warnings. One of which is:
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:
Consider amending your PATH so that /usr/local/bin is ahead of /usr/bin in your PATH.
How does one do what it's asking here?
Just run the following line in your favorite terminal application:
echo export PATH="/usr/local/bin:$PATH" >> ~/.bash_profile
Restart your terminal and run
the issue should be resolved
There are many ways to update your path. Jun1st answer works great. Another method is to augment your
.bash_profile to have:
$ echo $PATH /usr/local/bin:/usr/local/sbin:/Users/<your account>/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Once satisfied with the result running
$ brew doctor again should no longer produce your error.
This blog post helped me out in resolving issues I ran into. http://moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/
open bash profile in textEdit
open -e .bash_profile
Edit file or paste in front of PATH export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:~/bin
save & close the file
*To open .bash_profile directly open textEdit > file > recent
open your /etc/paths file, put /usr/local/bin on top of /usr/bin
$ sudo vi /etc/paths /usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin
and Restart the terminal, @mmel