title: How can I fix TypeErrors while downgrading Rubygems?
body: <p>I need to use Ruby 1.8.7 and rubygems &lt; 2.0 to work with an old application. When I attempt to downgrade the system rubygems to an older version I get this error:</p>
  
  <pre><code>$ sudo gem update --system 1.8.30
  Updating rubygems-update
  ERROR:  While executing gem ... (TypeError)
      can't convert nil into String
  </code></pre>
  
  <p>My current ruby and gem versions:</p>
  
  <pre><code>$ ruby --version
  ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin15.5.0]
  $ gem --version
  2.5.0
  </code></pre>
  
  <p>How can I fix this error (or get more information about what is causing the problem)?</p>