Fix rubygems 2.2 compatibility

This is follow up of #3234