Last active
August 29, 2015 13:56
-
-
Save aussielunix/8858155 to your computer and use it in GitHub Desktop.
reinstall all the rubies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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