You should use `StringValueCStr` instead of `RSTRING_PTR` here.