[CHEF-4275] Fix rubygems version heuristic to workaround old rubygem code getting loaded.

See commit message for full description.

Also includes a patch to make git functional tests work correctly without a user or email address configured.