sstephenson/rbenv — Issue #180: 'Why won't rbenv coexist with env?' or '`rbenv global` should install a symlink in .rbenv/bin  to placate /usr/bin/env.'
Author: blt
Created: 2012-01-19 22:57:10+00:00
State: open

The use of `ruby-local-exec` is undesirable if code must be distributed to or comes from non-rbenv environments. Consider [git-deploy](https://github.com/mislav/git-deploy): it installs a `deploy/before_restart` script that uses the following shebang:

#!/usr/bin/env ruby

Using git-deploy with rbenv this shebang must be modified to make use of `ruby-local-exec`. That's fine, if a bit frustrating: other tools must be patched to be compatible with rbenv, counter to the usual expectation of a tool author using `env`. The system is easily modified to provide the usual `env` behavior:

ln -s .rbenv/versions/1.9.3-p0/bin/ruby .rbenv/bin/ruby

Is there any reason why this is a poor idea? If there is, what alternatives exist to make rbenv play nicely with `env`?