Add support for Ruby 1.8

Reported-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>