Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 32 lines (27 sloc) 0.612 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#!/usr/bin/env bash
set -e
[ -n "$RBENV_DEBUG" ] && set -x

# Provide rbenv completions
if [ "$1" = "--complete" ]; then
  exec ruby-build --definitions
fi

if [ -z "$RBENV_ROOT" ]; then
  RBENV_ROOT="${HOME}/.rbenv"
fi

DEFINITION="$1"
case "$DEFINITION" in
"" | -* )
  { echo "usage: rbenv install VERSION"
    echo " rbenv install /path/to/definition"
    echo
echo "Available versions:"
    ruby-build --definitions | sed 's/^/ /'
    echo
  } >&2
  exit 1
  ;;
esac

VERSION_NAME="${DEFINITION##*/}"
PREFIX="${RBENV_ROOT}/versions/${VERSION_NAME}"

ruby-build "$DEFINITION" "$PREFIX"
rbenv rehash
Something went wrong with that request. Please try again.