How to upgrade rubygems
Install rubygems-update
gem install rubygems-update
update_rubygems
gem update --system
run this commands as root or use sudo.
You can update all gems by just performing:
sudo gem update
Or:
gem update `gem outdated | cut -d ' ' -f 1`
I found other answers to be inaccurate/outdated. Best is to refer to the actual documentation.
Short version: in most cases gem update --system
will suffice.
You should not blindly use sudo
. In fact if you're not required to do so you most likely should not use it.