fix detecting source ruby version for upgrade, fix #1424