这是Converting file path to URI的后续问题。
考虑:
require 'uri'
uri = URI.join('file:///', '/home/user/dir1/dir2/dir3/name.ext')
=> #<URI::Generic:0x0000000263fcc0 URL:file:/home/user/dir1/dir2/dir3/name.ext>
uri.to_s
=> "file:/home/user/dir1/dir2/dir3/name.ext"
结果不合法吗?不应该是"file://home/..."
双斜线吗?