Fix gem install --explain -g

This crashed due to a poor refactor in @d1299dcc combined with a lack
of tests.

Patch by @Elffers

Fixes #947