Should encode! raise that error? Did you test String#encode! on it's own for that?