Skip to content

Instantly share code, notes, and snippets.

@aussielunix
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aussielunix/8858155 to your computer and use it in GitHub Desktop.
Save aussielunix/8858155 to your computer and use it in GitHub Desktop.
reinstall all the rubies
#!/bin/bash
# CVE-2013-6393
# See: https://groups.google.com/forum/#!msg/rubysec-announce/3sx25iR7yHQ/gZOBulw_TeYJ
#
echo "Assumes you use rbenv and assumes your ruby-build is at ~/.rbenv/plugins/ruby-build"
echo "This will uninstall all your rbenv managed rubies and install them again."
echo "Pulling down the latest ruby-build"
cd ~/.rbenv/plugins/ruby-build && git pull && cd -
mkdir /tmp/rbenvupgrade
for RUBY in ~/.rbenv/versions/*
do
VER=`echo $RUBY | awk -F / '{ print $6 }'`
echo "uninstalling $VER"
rbenv uninstall -f $VER
echo "re-installing $VER"
rbenv install $VER
cd /tmp/rbenvupgrade
rbenv local $VER
gem install bundler
done
echo "rm -rf /tmp/rbenvupgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment