Fix building on Yosemite

Yosemite doesn't have Ruby 1.8 so switch to constructs that exist on both 1.8 and 2.0.