I think I know what the problem is, you're using puts or print in #to_s 
instead of returning the string. The puts and print methods return nil.

-- 
Posted via http://www.ruby-forum.com/.