Support both ree-1.8.7 and ruby 1.9.x