diff --git a/libexec/rbenv-prefix b/libexec/rbenv-prefix index e65be834..d583e1b1 100755 --- a/libexec/rbenv-prefix +++ b/libexec/rbenv-prefix @@ -22,7 +22,7 @@ elif [ -z "$RBENV_VERSION" ]; then fi if [ "$RBENV_VERSION" = "system" ]; then - if RUBY_PATH="$(rbenv-which ruby 2>/dev/null)"; then + if RUBY_PATH="$(rbenv-which ruby)"; then RUBY_PATH="${RUBY_PATH%/*}" RBENV_PREFIX_PATH="${RUBY_PATH%/bin}" echo "${RBENV_PREFIX_PATH:-/}" diff --git a/test/prefix.bats b/test/prefix.bats index bdee6f06..9a89910b 100644 --- a/test/prefix.bats +++ b/test/prefix.bats @@ -38,5 +38,8 @@ OUT @test "prefix for invalid system" { PATH="$(path_without ruby)" run rbenv-prefix system - assert_failure "rbenv: system version not found in PATH" + assert_failure <