Fix a test failure on Windows

This patch fixes a test failure on on RubyInstaller CI.
The test requires ruby only on Windows, but ruby is not available if
ruby is not installed. Instead we use Gem.ruby.
https://bugs.ruby-lang.org/issues/8058