Hello,
I'm new to Ruby. I've written a very simple program. It will not run on
Windows XP (at work), but it will run on Mac OS X (at home). I've tried
1.6.8 and 1.8.0 preview 2 on Windows XP and 1.6.7 on Mac OS X. Here's the
code:
require 'resolv'
class ResolverTest
def run()
dns = Resolv::DNS.new
dns.getresources("www.apogent.com",
Resolv::DNS::Resource::IN::A).collect {|r| r.address}
puts("#{r}\n")
end
end
resolver = ResolverTest.new()
resolver.run()
Here's the error:
C:/devtools/ruby/1.6.8/lib/ruby/1.6/resolv.rb:559:in `connect': The
requested address is not valid in its context. - "connect(2)"
(Errno::E10049)
from C:/devtools/ruby/1.6.8/lib/ruby/1.6/resolv.rb:559:in `initialize'
from C:/devtools/ruby/1.6.8/lib/ruby/1.6/resolv.rb:351:in `new'
from C:/devtools/ruby/1.6.8/lib/ruby/1.6/resolv.rb:351:in `lazy_initialize'
from C:/devtools/ruby/1.6.8/lib/ruby/1.6/resolv.rb:346:in `synchronize'
from C:/devtools/ruby/1.6.8/lib/ruby/1.6/resolv.rb:346:in `lazy_initialize'
from C:/devtools/ruby/1.6.8/lib/ruby/1.6/resolv.rb:413:in `each_resource'
from C:/devtools/ruby/1.6.8/lib/ruby/1.6/resolv.rb:408:in `getresources'
from C:\projects\test\ruby\TestProject/ResolverTest.rb:6:in `run'
from C:\projects\test\ruby\TestProject/ResolverTest.rb:12
Please share any ideas that you may have regarding this problem.
Thanks,
Craig