Fix build in Ruby 1.9

The error message is different, but the spirit is the same.

    # Ruby 1.9
    can't convert nil into String
    # Ruby 2.0
    no implicit conversion of nil into String