Fix for Issue #2470 - gem version string processing

This fix assumes that no sane gem version has spaces in it, so when one like that is encountered, it will get truncated at the first space.
Merge pull request #4344 from AndydeCleyre/patch-1

Fix for Issue #2470 - gem version string processing