Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binstubbed programs can't run binstubbed programs. #13

Open
docwhat opened this issue Feb 2, 2014 · 4 comments
Open

binstubbed programs can't run binstubbed programs. #13

docwhat opened this issue Feb 2, 2014 · 4 comments

Comments

@docwhat
Copy link

docwhat commented Feb 2, 2014

A binstubbed program can't run a binstubbed program as a sub-process within a project directory (with a Gemfile).

For example, guard (which runs rspec) runs the rspec under ${RBENV_ROOT}/versions/<version>/bin not the one in ${RBENV_ROOT}/shims.

This is because after rbenv exec "${program}" runs in the shim, the rbenv puts a bunch of other paths in front.

You can see this by running:

ruby -e "puts ENV['PATH']"

The first paths are the specific ruby version path in ${RBENV_ROOT}/versions, then the ${RBENV_ROOT}/plugins/*/bin directories and then finally comes the ${RBENV_ROOT}/shims directory.

Its an annoying failure only noticeable if you have more than one version of (for example) rspec installed and the wrong one is picked up by running ${RBENV_ROOT}/versions/<version>/bin/rspec.

@ianheggie
Copy link
Collaborator

I wonder if adding the binstub directory at the front of the path would work, or if we would get some execution loops? Any thoughts?

@docwhat
Copy link
Author

docwhat commented Feb 11, 2014

The shims run rbenv exec -- I don't know how that works. If it doesn't use the PATH, then it should work...

EDIT: I said 'binstubs' instead 'shims'.

@ianheggie ianheggie added the bug label May 18, 2014
@ianheggie
Copy link
Collaborator

I am no longer using rbenv, so I am happy to receive pull requests with tests to consider, but I am no longer actively developing the plugin.

@ianheggie
Copy link
Collaborator

I worked around this problem by swapping to chruby and direnv - Any takers for fixing this in rbenv-binstubs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants