[rubygems] Little fixes

a couple of little fixes

* one place improve exception handling
* fix encoding so generated xml is always utf-8
* more license headers

might conflict with https://github.com/sonatype/nexus-oss/pull/798