Fix build in 1.8.7

Array#each_with_object is not defined on ruby 1.8.7