title: OS X Mountain Lion: how does path_helper work?
body: <p>I installed rbenv through homebrew, and now I don't know why path_helper put ~/.rbenv/shims at the end of the path instead of the beginning. And most importantly, how did path_helper get this information?</p>
  
  <p>According to the man page of path_helper, it reads entries from /etc/paths and from files in /etc/paths.d. But I cannot find the string ".rbenv/shims" there.</p>
  
  <pre><code>~% cat /etc/paths 
  /usr/bin
  /bin
  /usr/sbin
  /sbin
  /usr/local/bin
  ~% ls -la /etc/paths.d 
  total 0
  drwxr-xr-x    2 root  wheel    68 Jun 21 03:16 .
  drwxr-xr-x  107 root  wheel  3638 Sep 10 09:59 ..
  ~% /usr/libexec/path_helper
  PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/gordon/.rbenv/shims"; export PATH;
  </code></pre>