title: gem cannot access rubygems.org
body: <p>I have a server with Rackspace that I use for a few Ruby sites. When I try  <code>bundle install</code> on a new site I get</p>
  
  <pre><code>Retrying download gem from http://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::UnknownHostError timed out (http://rubygems.org/gems/rake-12.3.1.gem)
  </code></pre>
  
  <p>Or trying <code>gem update --system</code> I get</p>
  
  <pre><code>ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
  timed out (http://api.rubygems.org/specs.4.8.gz)
  </code></pre>
  
  <p>What I have tried:</p>
  
  <ul>
  <li>Using curl to download the gem URL in the first error (successful)</li>
  <li>Change gem source from <a href="https://rubygems.org" rel="noreferrer">https://rubygems.org</a> to <a href="http://rubygems.org" rel="noreferrer">http://rubygems.org</a></li>
  <li>Change the name servers on the slice to use Google's</li>
  <li>Downloading and updating <code>gem</code> from source (on 2.7.6)</li>
  <li>Run <code>apt-get update</code></li>
  <li>Adding <code>AddTrustExternalCARoot-2048.pem</code></li>
  </ul>
  
  <p>What I haven't tried:</p>
  
  <ul>
  <li>Animal sacrifice</li>
  <li>Lucky rabbit foot</li>
  <li>Deleting all files and reinstalling the image</li>
  </ul>
  
  <p>I was finally (just before submitting this) able to get <code>bundle install</code> to work by removing rubygems.org  as a source and adding <a href="https://gems.ruby-china.org/" rel="noreferrer">https://gems.ruby-china.org/</a>. Why would gem be unable to access rubygems.org?</p>