title: How to install a gem or update RubyGems if it fails with a permissions error
body: <p>I'm trying to install a gem using <code>gem install mygem</code> or update RubyGems using <code>gem update --system</code>, and it fails with this error:</p>
  <pre class="lang-none prettyprint-override"><code>ERROR:  While executing gem ... (Gem::FilePermissionError)
  You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
  </code></pre>
  <p>Does anyone have an idea how to solve this?</p>