sstephenson/rbenv — pull request #249 by carsomyr (2012-07-31 00:49:24+00:00)
Title: Allow processing to continue in rbenv-which when command isn't found with system Ruby

When it detects the system Ruby, `rbenv-which` attempts to run `$(command -v "$RBENV_COMMAND")`, and this leads the script to [exit prematurely](https://github.com/sstephenson/rbenv/blob/master/libexec/rbenv-which#L53) because of a combination of a nonzero return value and the Bash mode `set -e`. I propose to mask the return value and leave the final checking to [later lines](https://github.com/sstephenson/rbenv/blob/master/libexec/rbenv-which#L62-77). Doing so leads to the expected behavior.

$ rbenv which blah
rbenv: blah: command not found

Without the patch, rbenv is totally silent. The patch also allows [my plugin](https://github.com/carsomyr/rbenv-bundler) to work correctly.