Skip to content

Instantly share code, notes, and snippets.

@yuhui
Created April 5, 2022 08:28
Show Gist options
  • Save yuhui/5dfb1def120343ba17abbcceca0a8241 to your computer and use it in GitHub Desktop.
Save yuhui/5dfb1def120343ba17abbcceca0a8241 to your computer and use it in GitHub Desktop.
Update Ruby's RVM, ruby, and gems
#!/bin/bash
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
fi
echo "$ rvm get stable --auto-dotfiles"
rvm get stable --auto-dotfiles
echo "$ rvm get head"
rvm get head
echo "$ rvm cleanup all"
rvm cleanup all
echo "$ gem update --system"
gem update --system
echo "$ rvm gemset use global"
rvm gemset use global
echo "$ gem update (global)"
gem update
echo "$ gem cleanup (global)"
gem cleanup
echo "$ rvm use @default"
rvm use @default
echo "$ gem update (@default)"
gem update
echo "$ gem cleanup (@default)"
gem cleanup
echo "$ rvm list"
rvm list
echo "$ rvm gemset list"
rvm gemset list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment