Skip to content

Instantly share code, notes, and snippets.

@wadtech
Last active April 14, 2022 21:39
Show Gist options
  • Save wadtech/95846fa7d0b072b7e4c4 to your computer and use it in GitHub Desktop.
Save wadtech/95846fa7d0b072b7e4c4 to your computer and use it in GitHub Desktop.
Reinstall rbenv just how I likes it.
#!/bin/bash
RBENV_LOC=$HOME/.rbenv
if [ -d $RBENV_LOC ]; then
rm -rf $RBENV_LOC
fi
echo 'Cloning rbenv...'
git clone --depth 1 -q https://github.com/rbenv/rbenv.git $RBENV_LOC
cd $RBENV_LOC && mkdir plugins
cd plugins
echo 'Cloning plugins...'
echo '...ruby-build...'
git clone --depth 1 -q https://github.com/rbenv/ruby-build.git
echo '...rbenv-update...'
git clone --depth 1 -q https://github.com/rkh/rbenv-update.git
echo '...rbenv-gem-rehash...'
git clone --depth 1 -q https://github.com/sstephenson/rbenv-gem-rehash.git
echo '...rbenv-default-gems...'
git clone --depth 1 -q https://github.com/sstephenson/rbenv-default-gems.git
echo 'Adding default gems...'
cd $RBENV_LOC
echo 'bundler' | tee default-gems
echo 'sass' | tee default-gems
echo 'rails' | tee default-gems
rbenv install 2.2.4 && rbenv global 2.2.4
echo 'ruby -v'
ruby -v
echo 'Ruby installed -probably- add the rbenv shim to your *rc file of choice: '
echo ' export PATH="$HOME/.rbenv/bin:$PATH"'
echo ' eval "$(rbenv init -)"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment