Bug #8113

ArgumentError: cannot interpret as DNS name: nil

Added by Jaz Lim about 1 year ago. Updated about 1 year ago.

[ruby-core:53500]
Status:Closed
Priority:Normal
Assignee:Akira Tanaka
Category:lib
Target version:-
ruby -v:2.0.0p0 Backport:

Description

Loading development environment (Rails 3.2.12)
irb(main):001:0> open("http://www.ruby-lang.org/") {|f|
irb(main):002:1* f.eachline {|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:in
generate
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:in
eachresource'
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:in
block 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:in
eachaddress'
from /usr/local/lib/ruby/2.0.0/resolv.rb:92:in getaddress'
from /usr/local/lib/ruby/2.0.0/resolv.rb:43:in
getaddress'
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:in
initialize'
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:in
block 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:in
connect'
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:in
start'
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:in
buffer
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:in
catch'
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:in
open_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:in
open'
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:in
start'
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:in
require'
from script/rails:6:in `'


Related issues

Related to Backport200 - Backport #8054: open-uri と resolv-replace を同時にロードすると壊れる Closed 03/09/2013

History

#1 Updated by Zachary Scott about 1 year ago

I cannot reproduce this with: ruby 2.1.0dev (2013-03-18 trunk 39805)
[x86_64-linux]

$irb -ropen-uri
open("http://www.ruby-lang.org/") { |f| f.each_line { |line| p line } }

Could you try it without rails?

#2 Updated by Eric Hodel about 1 year ago

  • Category set to lib
  • Status changed from Open to Closed
  • Assignee set to Akira Tanaka
  • ruby -v changed from 2.0.0 to 2.0.0p0

This was fixed by r39725. There is a backport ticket #8054

Also available in: Atom PDF