Fix build in ruby 1.8.7
Merge pull request #3358 from plribeiro3000/fix-travis-build-1.8.7

Fix build in ruby 1.8.7