So I’m having a path issue on OS X Leopard. It seems OS X is adding other paths that I’m not stating and it’s messing with my path priority. I only have a .bash_login file, I don’t have a .bashrc or a .profile file. My .bash_login file is as such:
export PATH='/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH'
When I run export this is the path it returns:
PATH='/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin'
Any ideas on what could be putting /usr/bin in there and how I could get /usr/local/bin to be a higher priority.
I’m tagging this for Rails too because that’s what I’m working on right now… it seems the Mac built-in Ruby, Rails, and Gems are taking priority over the one I have installed at /usr/local/bin, figured maybe you fellow Rubyists could help too.
Have you looked inside these two directories:
Any paths defined in files in those directories get appended automatically to PATH variable — I mostly use those two directories to put third-party installed applications in the PATH. Also, do have a look at the man page of
path_helperon OS X.EDIT: Looking at the contents of
/etc/profile, I can see thatpath_helperis executed first. The man page forpath_helpersays that prior to reading files in/etc/paths.d/and/etc/manpaths.d/directories,path_helperreads and sets up the paths defined in the files/etc/pathsand/etc/manpaths. A look at/etc/pathsreveals this:And, I believe, those account for the half of what you are seeing as set in PATH.