无法建立连接,因为目标计算机主动拒绝它。 - 连接(2)(Errno :: ECONNREFUSED)

时间:2015-02-09 11:44:00

标签: ruby

require 'net/http'
require 'uri'

#Function for Reading the Webpages

def open(url)
  Net::HTTP.get(URI.parse(url))
end


available_data_file=File.open('C:/Users/modi/Desktop/DataFile.txt', 'r+')
available_data_file.each do |definition|
  link=definition.split(/";"/)
  link.each do |address|
    spyware_url=address[3]
    spyware_data=open("#{spyware_url}")
    puts spyware_data
  end
end

我收到的错误如下::

c:/ruby/lib/ruby/1.8/net/http.rb:564:在initialize': No connection could be made because the target machine actively refused it. - connect(2) (Errno::ECONNREFUSED) from c:/ruby/lib/ruby/1.8/net/http.rb:564:in打开'     来自c:/ruby/lib/ruby/1.8/net/http.rb:564:在connect' from c:/ruby/lib/ruby/1.8/timeout.rb:48:in超时'     来自c:/ruby/lib/ruby/1.8/timeout.rb:76:in timeout' from c:/ruby/lib/ruby/1.8/net/http.rb:564:in connect'     来自c:/ruby/lib/ruby/1.8/net/http.rb:557:在do_start' from c:/ruby/lib/ruby/1.8/net/http.rb:546:in开始'     来自c:/ruby/lib/ruby/1.8/net/http.rb:379:在get_response' from c:/ruby/lib/ruby/1.8/net/http.rb:356:in得到'     从1983.rb:7:open' from 1983.rb:132 from 1983.rb:130:in每个'     从1983.rb:130     从1983.rb:128:in

0 个答案:

没有答案