title: Error fetching data: Errno::ENETUNREACH: A socket operation was attempted to an unreachable network. Error in installing gem
body: <p>I am new to Ruby on rails. My back end is PostgreSql. When i try to instal postgre sql with the command </p>
  
  <pre><code>$ gem install pg
  $ gem install ruby-postgres 
  </code></pre>
  
  <p>I get the following error.</p>
  
  <pre><code>WARNING:  Error fetching data: Errno::ENETUNREACH: A socket operation was attempted to an unreachable network. - connect(2) (http://rubygems.org/l
  atest_specs.4.8.gz)
  ERROR:  Could not find a valid gem 'pg' (&gt;= 0) in any repository
  ERROR:  Possible alternatives: pg
  </code></pre>
  
  <p>I am using eclipse IDE in windows 7 platform. I have set proxy with the following command</p>
  
  <pre><code>$ http_proxy="http:/192.168.xx.xxx:xxxx"
  </code></pre>
  
  <p>But it still not working. My frerence where <a href="https://memset.wordpress.com/2010/10/14/bash-http_proxy-from-a-user-environment-to-sudo-one/" rel="nofollow">this</a> ,<a href="http://guides.rubyonrails.org/getting_started.html" rel="nofollow">this</a> and <a href="http://rubyonrailswin.wordpress.com/2010/03/12/getting-postgresql-to-install-on-windows/" rel="nofollow">this</a></p>