Fix incorrect PATH setting with system-wide rbenv

When using system-wide rbenv (as in provided by vendor packages like in Ubuntu or
FreeBSD), PATH is not set to the correct ruby binary.
This leads to being unable to use rubies installed with rbenv (and stick with the
system-wide ruby installed, if any).
This patch correct this behaviour, setting the correct PATH.
This commit is contained in:
Michele Bologna 2015-09-23 16:08:58 +02:00
parent 76a26a2a59
commit af4c50c0ad

View File

@ -10,7 +10,7 @@ if _homebrew-installed && rbenv_homebrew_path=$(brew --prefix rbenv 2>/dev/null)
fi
for rbenvdir in "${rbenvdirs[@]}" ; do
if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
if [ -d $rbenvdir -a $FOUND_RBENV -eq 0 ] ; then
FOUND_RBENV=1
if [[ $RBENV_ROOT = '' ]]; then
RBENV_ROOT=$rbenvdir