The cause of the failure in the MinGW CI is the setting of ENV['BUNDLER_VERSION'] by ruby/setup-ruby, and also the fact that the RubyGems test suite (maybe TestCase?) is not accounting for that ENV variable in its setup.
I removed the setting in both ruby-loco and the MinGW CI here, and all of them passed. As mentioned above, I couldn't repo this locally, and the ruby-loco build passed in AppVeyor. Neither had ENV['BUNDLER_VERSION'] set...
I may do a PR, as this should be guarded against regardless?
Sorry about that. Yes, it would be useful to handle this better in RubyGems' test suite, either raise an error if it's set or make sure it's unset while running the tests.
Thanks. I checked MinGW in my ruby fork, so I haven't done PR. Will you add a release in setup-ruby? Not sure when RubyGems would be patched, probably better if the patch comes from RubyGems? I did open a (passing) PR there for TestCase.