title: Why do I get "Errno::ECONNREFUSED" with 'net/http' in Rails?
body: <p>I am trying to parse an XML file from a URL. When I try something like this:</p>
  
  <pre><code>require 'net/http'
  require 'rubygems'
  require 'xmlsimple'
  
  url = 'http://my-address.com/xmltest/note.xml'
  xml_data = Net::HTTP.get_response(URI.parse(url)).body
  </code></pre>
  
  <p>Everything works, but only when I do this outside of my Rails project. If I try including this file in my Rails 3 project and parsing it there, I get the error <code>"Errno::ECONNREFUSED in [controller]" - Connection refused - connect(2)</code>.</p>
  
  <p>My problem is the following: I don't know how to install the <code>net/http</code> component. I am looking for it on <a href="http://www.rubygems.org" rel="noreferrer">http://www.rubygems.org</a>, but I can't find it. </p>