From: Gareth Adams Date: 2007-10-01T19:02:45+09:00 Subject: URI.join inconsistency I just got stung by rather annoying feature of URI.join: irb(main):001:0> URI.join('http://www.example.com/something', 'else').to_s => "http://www.example.com/else" Note that this completely ignores the 'something' in the original URI. I had assumed that it joined in a similar way to File.join: irb(main):002:0> File.join('/something', 'else').to_s => "/something/else" I notice that adding a slash works as expected, but why is there a difference? Is there something in the HTTP spec that defines URI joining like this? irb(main):001:0> URI.join('http://www.example.com/something/', 'else').to_s => "http://www.example.com/something/else" Maybe this is a case of incomplete documentation not explaining what the join is actually doing, this doesn't seem to be 'least surprising' approach at the moment.