Skip to content

Instantly share code, notes, and snippets.

@mattes
Last active January 7, 2017 00:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattes/6989885 to your computer and use it in GitHub Desktop.
Save mattes/6989885 to your computer and use it in GitHub Desktop.
rbenv one-line installer
#!/usr/bin/env bash
# curl https://gist.github.com/mattes/6989885/raw/rbenv-install.sh | bash
if [[ $(uname) == "Darwin" ]]; then
brew install rbenv ruby-build
echo "Add the following to ~/.bash_profile ..."
echo 'eval "$(rbenv init -)"'
else
# linux ...
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo "Add the following to ~/.bash_profile ..."
echo "echo 'export PATH="\$HOME/.rbenv/bin:\$PATH"' >> ~/.bash_profile"
echo "echo 'eval "\$\(rbenv init -\)"' >> ~/.bash_profile"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment