diff --git a/libexec/rbenv-version-name b/libexec/rbenv-version-name index 3769a7cd..90609d7f 100755 --- a/libexec/rbenv-version-name +++ b/libexec/rbenv-version-name @@ -23,6 +23,6 @@ if version_exists "$RBENV_VERSION"; then elif version_exists "${RBENV_VERSION#ruby-}"; then echo "${RBENV_VERSION#ruby-}" else - echo "rbenv: version \`$RBENV_VERSION' is not installed" >&2 + echo "rbenv: version \`$RBENV_VERSION' is not installed (set by $(rbenv-version-origin))" >&2 exit 1 fi diff --git a/libexec/rbenv-which b/libexec/rbenv-which index 3cf91de7..8019be21 100755 --- a/libexec/rbenv-which +++ b/libexec/rbenv-which @@ -52,7 +52,7 @@ done if [ -x "$RBENV_COMMAND_PATH" ]; then echo "$RBENV_COMMAND_PATH" elif ! [ -d "${RBENV_ROOT}/versions/${RBENV_VERSION}" ]; then - echo "rbenv: version \`$RBENV_VERSION' is not installed" >&2 + echo "rbenv: version \`$RBENV_VERSION' is not installed (set by $(rbenv-version-origin))" >&2 exit 1 else echo "rbenv: $RBENV_COMMAND: command not found" >&2 diff --git a/test/exec.bats b/test/exec.bats index 889eb897..ff1e248d 100644 --- a/test/exec.bats +++ b/test/exec.bats @@ -17,7 +17,7 @@ create_executable() { @test "fails with invalid version" { export RBENV_VERSION="2.0" run rbenv-exec ruby -v - assert_failure "rbenv: version \`2.0' is not installed" + assert_failure "rbenv: version \`2.0' is not installed (set by RBENV_VERSION environment variable)" } @test "completes with names of executables" { diff --git a/test/version-name.bats b/test/version-name.bats index d6438b5b..8d61ac55 100644 --- a/test/version-name.bats +++ b/test/version-name.bats @@ -49,7 +49,7 @@ setup() { @test "missing version" { RBENV_VERSION=1.2 run rbenv-version-name - assert_failure "rbenv: version \`1.2' is not installed" + assert_failure "rbenv: version \`1.2' is not installed (set by RBENV_VERSION environment variable)" } @test "version with prefix in name" { diff --git a/test/which.bats b/test/which.bats index 3f68a31a..bf10effe 100644 --- a/test/which.bats +++ b/test/which.bats @@ -59,7 +59,7 @@ create_executable() { @test "version not installed" { create_executable "2.0" "rspec" RBENV_VERSION=1.9 run rbenv-which rspec - assert_failure "rbenv: version \`1.9' is not installed" + assert_failure "rbenv: version \`1.9' is not installed (set by RBENV_VERSION environment variable)" } @test "no executable found" {