Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9054557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:43:09+00:00 2026-06-16T13:43:09+00:00

I installed rbenv through homebrew, and now I don’t know why path_helper put ~/.rbenv/shims

  • 0

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?

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.

~% 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;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:43:10+00:00Added an answer on June 16, 2026 at 1:43 pm

    I suspect that your .bash_profile or .bashrc is adding
    .rbenv/shims to your PATH, and that is running at some point before
    path_helper is invoked during the shell start-up.

    The man page for path_helper opens with:

     The path_helper utility reads the contents of the files in the directo-
     ries /etc/paths.d and /etc/manpaths.d and appends their contents to the
     PATH and MANPATH environment variables respectively.
    

    The crucial point here is that the path_helper utility is intended to
    add contents to an existing PATH setting, not replace them. (And in
    actuality, what it really does is prepend contents, not append them,
    which matters for PATH variables…)

    So, if I start out with an entry on my PATH, the setting generated by
    path_helper will ensure that entry continues on the PATH it generates.

    % echo $SHELL
    /bin/bash
    % uname
    Darwin
    % /usr/libexec/path_helper 
    PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"; export PATH;
    % PATH="" /usr/libexec/path_helper 
    PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"; export PATH;
    % PATH=foo /usr/libexec/path_helper 
    PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:foo"; export PATH;
    

    Note that foo has been included in my PATH in the last line, even though
    the contents of /etc/paths and /etc/paths.d/* have not changed.

    At the same time, the path_helper utility also seems to be careful not
    to produce paths with duplicate entries; it removes duplicate entries
    after concatenating /etc/paths and /etc/paths.d/* and the current
    PATH.

    This latter detail can be especially confusing since it can cause
    entry reorderings compared to the original PATH setting (!).

    Below are some examples of this behavior: The first case shows a duplicate foo being removed. The second and third case illustrate entry reordering: the generated PATH is the same in both cases, but in the third case, the /usr/bin entry has been moved from in-between foo and bar to the front of the PATH. (This duplicate-entry removal seems to be based on just simple string-matching on the pairs of entries, as illustrated by the fourth case below where the string /usr/bin/ remains between foo/ and bar.)

    % PATH=foo:foo /usr/libexec/path_helper 
    PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:foo"; export PATH;
    % PATH=foo:bar /usr/libexec/path_helper 
    PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:foo:bar"; export PATH;
    % PATH=foo:/usr/bin:bar /usr/libexec/path_helper 
    PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:foo:bar"; export PATH;
    % PATH=foo/:/usr/bin/:bar /usr/libexec/path_helper 
    PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:foo/:/usr/bin/:bar"; export PATH;
    

    Finally, to give credit where credit is due:
    While all of the command sequences above are the result of my own investigations, I was originally inspired to look into the behavior of path_helper after reading the note here,
    which pointed out that path_helper reuses the PATH environment variable set by the parent process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I installed Python through MacPorts, and then changed the path to that one. /opt/local/bin/python
I've installed ruby-1.9.2-p290 using ruby-build. I used the command ruby-build 1.9.2-p290 ~/.rbenv/versions/1.9.2-p290 Now, How
I have decided to give rbenv a go instead of rvm. I have installed
I was following along with Ryan's RailsCast Episode 339. I had installed rbenv and
I installed CLisp today on my Win7 PC. Please don't criticize my environment choices,
I installed the ADT plugin for Android for Eclipse, and I don't like it.
So I just ditched rvm in order to try rbenv. I installed with macports
Installed a captcha on my blog, been good up until now. There have recently
I installed rbenv according to the github directions. I am running OSX but I
I installed R (2.15.1) and RStudio (0.96.316) on a new mac. Now everytime I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.