1

My PATH no longer includes /usr/local/bin even though it is the first line of /etc/paths:

#/etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

$PATH:

$ echo $PATH
/usr/bin:/bin:/Users/meltemi/.rvm/bin

What changed? Well all was working fine until:

Recently updated RVM from 1.24.8 -> 1.25.13 on an OS X 10.9.1 machine with rvm get stable

RVM warned me that there was "old stuff laying around" and to run rvm cleanup all, so I did.

Then I upgraded Ruby rvm upgrade 2.0.0-p353 2.1 migrating gemsets along the way...

Edit:

I'm using zsh:

#~/.zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
...
source $ZSH/oh-my-zsh.sh

# load RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 

## from brew info zsh
#Add the following to your zshrc to access the online help:
unalias run-help
autoload run-help
HELPDIR=/usr/local/share/zsh/helpfiles
  • 1
    Are you using bash or zsh or another shell? Have you checked the .profile type files for syntax errors that are preventing /etc/paths from getting sourced? PATH=foo with foo not containing the pre-existing $PATH would be something to watch for. – bmike Jan 8 '14 at 18:16
  • I'm using zsh and I don't see any obvious errors in .zshrc (see edit above) – Meltemi Jan 8 '14 at 18:31
  • Good - there are only three places you could have a problem. The system, rvm or oh-my-zsh. My answer might assist in knowing if it's the system or one of the two additions you are running. – bmike Jan 8 '14 at 18:39
2

It is not an issue with rvm, but with homebrew:

Since 15th of December 2013 zsh is not longer build with the --enable-etcdir flag by default. Therefore /usr/libexec/path_helper is no longer used to initialize $PATH and all path in /etc/paths as well as in /etc/paths.d are completely ignored. (I know, I just found out myself and am speechless as well.)

Therefore either run brew update; brew reinstall zsh --enable-etcdir or add the following to your .zshrc:

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`
fi

For more information on why this was removed, check this ticket on github.

0

I can't guess where your problem lies, but here is how I would troubleshoot it.

  1. set aside your .zshrc file mv ~/.zshrc ~/zshrc
  2. open a new terminal window, switch to bash
  3. check path (just to see if it shows any changes)
  4. run zsh in verbose mode zsh -v

Watch carefully on the /usr/libexec/path_helper output and consider running it by hand to see how your path is being assembled.

Once you have a good path, you can add back part or all of your .zshrc file and re-test.

  • did step 1. opening a new terminal window (zsh) and then typing bash to switch brought me a world of hurt with missing refs, etc. So tried just a blank .zshrc and new zsh terminal and now $PATH is even shorter: "/usr/bin:/bin". Like it's not referencing etc/paths at all!?! – Meltemi Jan 8 '14 at 18:57
  • /usr/libexec/path_helper appears to be a binary file?!? unreadable. starting to think this problem may be at system level. why isn't /etc/paths being sourced? – Meltemi Jan 8 '14 at 19:43
  • Oh - you run it /usr/libexec/path_helper -s and it parses the various files and spits out a path formed for bash in this case. See the man page for the options... – bmike Jan 8 '14 at 20:05

You must log in to answer this question.

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