Fix 1.8.7 builds on Travis

travis-ci/travis-ci#1793
rubygems/rubygems#763