backport r48265 without to using refinements
Merge pull request #1061 from rubygems/backport-r48265

backport r48265 without to using refinements