Remove warnings on Ruby 2.1

Backport commit https://github.com/Shopify/shopify/commit/a9954bb6e3cf0e52559a665327606690fe384a93 to fix #14188

After `git bisect` turns out this commit fix ruby 2.1.1.

review @carlosantoniodasilva @tenderlove