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

rbenv-rehash + rbenv-gemsets produces a spurious shim #12

Closed
telemachus opened this issue Aug 4, 2011 · 1 comment
Closed

rbenv-rehash + rbenv-gemsets produces a spurious shim #12

telemachus opened this issue Aug 4, 2011 · 1 comment

Comments

@telemachus
Copy link
Contributor

I wasn't sure whether to post this bug here or on rbenv-gemsets, so I'm putting it here and cc-ing @jamis.

Once you have rbenv-gemsets installed, rehashing can produce a spurious file in shims called * (no joke). I can't even figure out a way to explain it briefly, so I'm just going to show how I found it:

  1. At the top of make_shims in rbenv-rehash add echo "glob: $@"

  2. Run rbenv rehash

  3. Get this result:

    glob: ../versions/1.9.2-p290/bin/erb ../versions/1.9.2-p290/bin/gem ../versions/1.9.2-p290/bin/irb ../versions/1.9.2-p290/bin/rake ../versions/1.9.2-p290/bin/rdoc ../versions/1.9.2-p290/bin/ri ../versions/1.9.2-p290/bin/ruby ../versions/1.9.2-p290/bin/testrb
    
    glob: /Users/telemachus/.rbenv/versions/*/gemsets/*/bin/*
    

That second item gets truncated to *, a file of that name is created and then treated as a proper shim. At the moment, this isn't a huge deal, but it's worth considering now before the gemsets idea grows.

@jamis
Copy link
Contributor

jamis commented Aug 4, 2011

Yeah, this is an issue with rbenv-gemsets, not rbenv. The rehash/gemset.bash plugin should have shopt -s nullglob, so that it expands to nothing instead of the glob pattern when nothing matches. I thought I had that in there, honestly; I must have removed it during experimenting and forgot to add it back. I'll work on that tonight.

@jamis jamis closed this as completed Aug 4, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants