Skip to content

Instantly share code, notes, and snippets.

@JesseHerrick
Created December 26, 2013 19:52
Show Gist options
  • Save JesseHerrick/8137946 to your computer and use it in GitHub Desktop.
Save JesseHerrick/8137946 to your computer and use it in GitHub Desktop.
Install RBEnv on OSX/Linux
# Download RBEnv
git clone git://github.com/sstephenson/rbenv.git $HOME/.rbenv
# Find out which shell init file exists.
if [ -f $HOME/.zshrc ]
then
SHELL_INIT="$HOME/.zshrc"
elif [ -f $HOME/.bashrc ]
then
SHELL_INIT="~/.bashrc"
elif [ -f $HOME/.bash_profile ]
then
SHELL_INIT="$HOME/.bash_profile"
else
echo "No shell init!"
fi
cat << EOF >> $SHELL_INIT
export RBENV_ROOT=$HOME/.rbenv
export PATH="${RBENV_ROOT}/bin:$PATH"
eval "$(rbenv init -)"
EOF
# Download rubybuild
git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build
# Never run `rbenv rehash` again!
git clone https://github.com/sstephenson/rbenv-gem-rehash.git $HOME/.rbenv/plugins/rbenv-gem-rehash
echo "RBEnv installed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment