When I run brew doctor, I get /user/bin occurs before /usr/local/bin So I changed my /etc/paths and my ~/.MacOSX/environment.plist as this post said to do. When I run brew doctor again, I still get the same error. Any tips? Thanks
2 Answers
If you change environment files, you have to tell the shell to manually read them to update the environment. Closing the terminal and reopening is one way to do it, but a more efficient way is to use the source command.
Also, I would avoid editing any files that require sudo access, such as /etc/paths. A safer way to edit your path would be to add the line
export PATH=/new/path/name/:$PATH
to the file ~/.profile (it may not exist on your computer) then run
$ source ~/.profile
to have your changes take effect. By editing your ~/.profile instead of a system file such as /etc/paths you are safeguarding against user error. If you need to reset to the default PATH settings at some point in the future, simply delete that line from ~/.profile. However, you will have to manually change /etc/paths again to revert to default. ~/.profile will automatically be sourced by Terminal.app when a new shell is opened if it exists, so you only need to do this once.
- 368
- 2
- 8
Whenever you change environment settings, you have to start a new shell to pick up those changes. This is by design, to ensure that changes you make won't impact existing shell sessions.
You will see this behaviour in most OSes.