Only set installed_by_version when supported

This allows gems installed by 2.2.0+ to work with previous versions.