I don't see why... It seems to work for me...
I'm not a ruby expert, so maybe I've missed some nuance.
What error are you getting?