Line 28:
installed_gems = Gem::SourceIndex.from_installed_gems.gems.map{|k,v|v}
gives a rubygems deprecation warning with rubygems 1.8.10
As far as I found out, this helps:
installed_gems = Gem::Specification
The best would be to test against the rubygems version and use either on or the other.