rubygems/rubygems — pull request #674 by jkanywhere (2013-10-08 04:07:55+00:00)
Title: Bug fix Gem::Version.create

Do not assume an object is of type Gem::Version just because it responds to
:version

I ran into problems using rubygems 2.1.0 and 2.1.5, but not 2.0.0 or 1.8.15.

This gist, https://gist.github.com/jkanywhere/ebb0847d4b142b3527b7, shows the error messages which mostly look like

Invalid gemspec in [/Users/jkanywhere/.rvm/gems/ruby-1.9.3-p448/specifications/aruba-0.5.3.gemspec]: undefined method `prerelease?' for "0.5.3":String

@mpapis was instrumental in tracking the problem down to bad casting in the `Gem::Version.create` method. This change fixed the problems on my system.