Description of problem: # The name of this file is bug.rb require 'uri' ENV['http_proxy']='http://127.0.0.1' ENV['no_proxy']='192.0.2.2' URI("http://example.org/").find_proxy $ ruby bug.rb /home/m/.rbenv/versions/2.4.0/lib/ruby/2.4.0/ipaddr.rb:563:in `in6_addr': invalid address (IPAddr::InvalidAddressError) from /home/m/.rbenv/versions/2.4.0/lib/ruby/2.4.0/ipaddr.rb:500:in `initialize' from /home/m/.rbenv/versions/2.4.0/lib/ruby/2.4.0/ipaddr.rb:518:in `new' from /home/m/.rbenv/versions/2.4.0/lib/ruby/2.4.0/ipaddr.rb:518:in `coerce_other' from /home/m/.rbenv/versions/2.4.0/lib/ruby/2.4.0/ipaddr.rb:174:in `include?' from /home/m/.rbenv/versions/2.4.0/lib/ruby/2.4.0/uri/generic.rb:1541:in `block in find_proxy' from /home/m/.rbenv/versions/2.4.0/lib/ruby/2.4.0/uri/generic.rb:1530:in `scan' from /home/m/.rbenv/versions/2.4.0/lib/ruby/2.4.0/uri/generic.rb:1530:in `find_proxy' from bug.rb:4:in `<main>' Version-Release number of selected component (if applicable): ruby-libs-2.4.1-79.fc26.x86_64 How reproducible: $ http_proxy=http://127.0.0.1 no_proxy=192.0.2.2 ruby -ropen-uri -e 'open("http://example.org")' Actual results: see above
I can confirm that this patch solves the problem.
This was addressed in Ruby 2.4.2