fix sorting ruby versions in upgrade, fix #2657