Try a different ruby version/patch.
If that fixes it, then it's probably a bug in 1.9.3p362. You should probably submit a bug report so the core devs know about it, or, if you're up for it, take a look at the source and try to patch it yourself and submit that.