I can't upgrade RubyGems from 1.1.1 to 1.2.0 on Ubuntu

Just a quick little snippet here. RubyGems 1.2.0 dropped roughly two weeks ago....however, I'd been having trouble getting my 1.1.1 installs on Ubuntu to update properly.

john@john-ubuntu:~/passenger-recipes$ gem -v  
1.1.1  
john@john-ubuntu:~/passenger-recipes$ sudo gem update --system  
Updating RubyGems  
Nothing to update  
john@john-ubuntu:~/passenger-recipes$ gem -v  
1.1.1  
john@john-ubuntu:~/passenger-recipes$ sudo gem update --system  
Updating RubyGems  
Nothing to update  

The first few times I ran into this, I was too busy to figure out what was wrong and ignored it. However, there is one HUGE TIME SAVER in 1.2.0 that I just couldn't wait for any longer. Up through 1.1.1, gem update and gem install calls both updated all locally cached gemspec's from your gem sources. This not only led to large memory consumption (anyone on a VPS got a horror story?), but was also just a plain waste of time. If I know which gem I want to update, it should just update that gem. The onus should be on me specify that I want to fully update my cache.

That said, I finally came across Eric Hodel's notice addressing this very problem. The solution:

john@john-ubuntu:~/passenger-recipes$ <strong>sudo gem install rubygems-update -v 1.1.1</strong>  
Bulk updating Gem source index for: http://gems.rubyforge.org/  
Successfully installed rubygems-update-1.1.1  
1 gem installed  
john@john-ubuntu:~/passenger-recipes$ <strong>sudo gem update --system</strong>  
Updating RubyGems  
Updating rubygems-update  
Successfully installed rubygems-update-1.2.0  
Updating version of RubyGems to 1.2.0  
Installing RubyGems 1.2.0  
...
... (success)
...
john@john-ubuntu:~/passenger-recipes$ <strong>gem -v</strong>  
1.2.0  

Happy upgrading.

comments powered by Disqus