Commit e46986c7 authored by Sam Stephenson's avatar Sam Stephenson
Browse files

Default RBENV_VERSION to the globally-specified Ruby

Fixes `rbenv install` in a directory with a .ruby-version file that specifies ree
parent b4fd8e94
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -142,6 +142,12 @@ if [ -z "${RUBY_BUILD_CACHE_PATH}" ] && [ -d "${RBENV_ROOT}/cache" ]; then
  export RUBY_BUILD_CACHE_PATH="${RBENV_ROOT}/cache"
fi

# Default RBENV_VERSION to the globally-specified Ruby version. (The
# REE installer requires an existing Ruby installation to run. An
# unsatisfied local .ruby-version file can cause the installer to
# fail.)
export RBENV_VERSION="$(rbenv global 2>/dev/null || true)"


# Execute `before_install` hooks.
for hook in "${before_hooks[@]}"; do eval "$hook"; done