title: undefined method `hostname' for "'http://www.google.com/":String (NoMethodError)
body: <p>I have the following code to get <code>google.com</code></p>
  
  <pre><code>class Geocoder
      def self.locate()
  
          uri="http://www.google.com/"
  
  
  
          puts Net::HTTP.get(uri)
  
  end
  </code></pre>
  
  <p>but i faced with the erorr:</p>
  
  <pre><code>undefined method `hostname' for "'http://www.google.com/":String (NoMethodError)
  </code></pre>
  
  <p>I have already seen <a href="https://stackoverflow.com/questions/13434507/ruby-http-post-errors">this</a>, and my ruby version is: <code>ruby 2.2.1</code></p>