The correct way to update the version of a gem to a specific version is to specify the version you want in your Gemfile, then run bundle install . As for why your command line was failing, there is no -version option.
If this is the case, you can look on /usr/lib/ruby/gems/1.8/gems/rubygems-update-x.x.x and take the directory with the highest value of x.x.x.
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.
You can update gem to any specific version like this,
gem update --system 'version'
gem update --system '2.3.0'
I wouldn't use the debian packages, have a look at RVM or Rbenv.
For me it sufficed to simply run
gem update
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With