Fix `ruby_gem` install errors on Rubinius due to encoding
Fix `ruby_gem` install errors on Rubinius due to encoding

Fixes this error when `ruby_gem` tries to install e.g. Bundler v1.6.9 on
any version on Rubinius:

    invalid gem: package is corrupt, exception while verifying:
    invalid byte sequence in US-ASCII (ArgumentError)

This is due to the fact that Puppet sets `LANG=C` by default on
everything it executes to ensure a level playing field. In Ruby, this
sets `Encoding.default_external` to ASCII, causing the files to be read
in as ASCII by default and chokes if that input has any non-ASCII
characters like some gemspecs do due to authors' names. This might be a
RubyGems bug (v2.2.2) but it seems to happen only on Rubinius, for
reasons unknown to me.

Simply setting `LANG` in custom_environment when executing `gem`
commands doesn't take effect because Puppet still overrides it. This
smells like a Puppet bug. To have Puppet stop overriding LANG,
`:override_locale => false` is required.

dieterdemeyer/puppet-ruby,RallySoftware/boxen-ruby,boxen/puppet-ruby,halyard/puppet-ruby,RallySoftware/boxen-ruby,boxen/puppet-ruby,halyard/puppet-ruby,dieterdemeyer/puppet-ruby