Skip to content

Instantly share code, notes, and snippets.

@odlp
Last active May 3, 2020 10:06
Show Gist options
  • Save odlp/c6d5ef861bc9c6a29bcff413f6453e9a to your computer and use it in GitHub Desktop.
Save odlp/c6d5ef861bc9c6a29bcff413f6453e9a to your computer and use it in GitHub Desktop.
Rbenv update Rubygems
#!/usr/bin/env sh
# Multiple vulnerabilities have been disclosed in RubyGems:
# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/
#
# And again in March 2019:
# https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html
#
# If you're an Rbenv user, here's any easy one-liner to upgrade to a
# safe version of Rubygems (2.7.8 / 3.0.3 or later) for each installed Ruby version:
for i in $( rbenv versions --bare ); do RBENV_VERSION=$i gem update --system && echo "\n$(ruby -v) using rubygems $(gem --version)\n"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment