Change the erb rake task for Ruby 1.8 compatibility.

KeyError and define_singleton_method were introduced in
Ruby 1.9.  This patch allows us to continue building on RHEL 6.5.