Ensure version is a string
Use RubyGems' Versions objects instead of strings

This help us build comparison between "1.10.0" and "1.7.0" and
determine 1.10.0 > 1.7.0 (contrary to normal string comparison)
Preselect and pick recipe candidates

Instead of using the first that matches the conditions, always pick
the lastest one since candidates will be ordered by version, being
the bigger (newer) the latest.