We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a72a81b commit 7b4b51aCopy full SHA for 7b4b51a
bin/rbenv-install
@@ -6,4 +6,21 @@ if [ -z "$RBENV_ROOT" ]; then
6
RBENV_ROOT="${HOME}/.rbenv"
7
fi
8
9
-exec ruby-build "$1" "${RBENV_ROOT}/versions/$1"
+DEFINITION="$1"
10
+case "$DEFINITION" in
11
+"" | -* )
12
+ { echo "usage: rbenv install VERSION"
13
+ echo " rbenv install /path/to/definition"
14
+ echo
15
+ echo "Available versions:"
16
+ ruby-build --definitions | sed 's/^/ /'
17
18
+ } >&2
19
+ exit 1
20
+ ;;
21
+esac
22
+
23
+VERSION_NAME="${DEFINITION##*/}"
24
+PREFIX="${RBENV_ROOT}/versions/${VERSION_NAME}"
25
26
+exec ruby-build "$DEFINITION" "$PREFIX"
0 commit comments