W dniu 30 marca 2012 13:28 uytkownik Bartosz Dziewoski
<matma.rex / gmail.com> napisa:
> Underscore is not a valid character in a hostname, thus Ruby rejects it.
>
> To allow it, you have to manually add it to the regex in library file
> uri/common.rb, line 368. (On my Windows install,
> F:\Ruby193\lib\ruby\1.9.1\uri), to looks like this:
>
> ret[:HOSTNAME] = hostname = "(?:[a-zA-Z0-9\\-._]|%\\h\\h)+"
>
> (I just added an underscore there.) This might of course break URI
> parsing for other protocols.

The line before editing looks like this:

  ret[:HOSTNAME] = hostname = "(?:[a-zA-Z0-9\\-.]|%\\h\\h)+"

(I am on Ruby 1.9.3)

 -- Matma Rex