ArgumentError: cannot interpret as DNS name: nil

Loading development environment (Rails 3.2.12)
irb(main):001:0> open("http://www.ruby-lang.org/") {|f|
irb(main):002:1* f.each_line {|line| p line}
irb(main):003:1> }
ArgumentError: cannot interpret as DNS name: nil
from /usr/local/lib/ruby/2.0.0/resolv.rb:1176:in create'
from /usr/local/lib/ruby/2.0.0/resolv.rb:1022:ingenerate_candidates'
from /usr/local/lib/ruby/2.0.0/resolv.rb:1047:in resolv'
from /usr/local/lib/ruby/2.0.0/resolv.rb:513:ineach_resource'
from /usr/local/lib/ruby/2.0.0/resolv.rb:406:in each_address'
from /usr/local/lib/ruby/2.0.0/resolv.rb:115:inblock in each_address'
from /usr/local/lib/ruby/2.0.0/resolv.rb:114:in each'
from /usr/local/lib/ruby/2.0.0/resolv.rb:114:ineach_address'
from /usr/local/lib/ruby/2.0.0/resolv.rb:92:in getaddress'
from /usr/local/lib/ruby/2.0.0/resolv.rb:43:ingetaddress'
from /usr/local/lib/ruby/2.0.0/resolv-replace.rb:10:in getaddress'
from /usr/local/lib/ruby/2.0.0/resolv-replace.rb:22:ininitialize'
from /usr/local/lib/ruby/2.0.0/net/http.rb:877:in open'
from /usr/local/lib/ruby/2.0.0/net/http.rb:877:inblock in connect'
from /usr/local/lib/ruby/2.0.0/timeout.rb:51:in timeout'
from /usr/local/lib/ruby/2.0.0/net/http.rb:876:inconnect'
from /usr/local/lib/ruby/2.0.0/net/http.rb:861:in do_start'
from /usr/local/lib/ruby/2.0.0/net/http.rb:850:instart'
from /usr/local/lib/ruby/2.0.0/open-uri.rb:313:in open_http'
from /usr/local/lib/ruby/2.0.0/open-uri.rb:708:inbuffer_open'
from /usr/local/lib/ruby/2.0.0/open-uri.rb:210:in block in open_loop'
from /usr/local/lib/ruby/2.0.0/open-uri.rb:208:incatch'
from /usr/local/lib/ruby/2.0.0/open-uri.rb:208:in open_loop'
from /usr/local/lib/ruby/2.0.0/open-uri.rb:149:inopen_uri'
from /usr/local/lib/ruby/2.0.0/open-uri.rb:688:in open'
from /usr/local/lib/ruby/2.0.0/open-uri.rb:34:inopen'
from (irb):1
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:8:instart'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:41:in <top (required)>'
from script/rails:6:inrequire'
from script/rails:6:in `'