The logic of this code is questionable, but it has worked for a while and the behavior seem to have changed in the last couple weeks:
puts URI.join("http://example.com/", "//", "path")
3.2 and older:
3.3.0-dev:
I'll try to figure out what caused this and provide a fix.