title: How to install gems without sudo on Mac OS X
body: <p>I've read numerous posts but none so far has done the trick. </p>
  
  <p>How can I, on OSX (El Capitan Beta) install a gem for my own user? Posts suggest specifying <code>-user-install</code> for example but I cannot call <code>gem</code> without <code>sudo</code> at all as it throws permission errors.</p>
  
  <p>I followed "<a href="http://charles.lescampeurs.org/2015/02/25/install-gem-as-user-on-osx-10-10-yosemite" rel="nofollow noreferrer">Install gem as user on OSX 10.10 Yosemite</a>"  but still cannot call <code>gem</code>.</p>
  
  <p>I installed Homebrew, installed rbenv per the above guide, installed a version of Ruby with rbenv, checked it was loaded correctly, but the final step in the guide is to call <code>gem install</code> which I still cannot do.</p>
  
  <p>Calling <code>gem</code> after installing <code>rbenv</code> results in:</p>
  
  <pre><code>/Users/Me/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/stub_specification.rb:71:in `initialize': 
  Permission denied @ rb_sysopen - /Users/Ne/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/speci
  </code></pre>
  
  <p>rbenv env dump:</p>
  
  <pre><code>RBENV_VERSION=2.1.5
  RBENV_ROOT=/Users/Me/.rbenv
  RBENV_HOOK_PATH=:/Users/Me/.rbenv/rbenv.d:
    /usr/local/etc/rbenv.d:
    /etc/rbenv.d:
    /usr/lib/rbenv/hooks
  PATH=/Users/Me/.rbenv/versions/2.1.5/bin:
    /usr/local/Cellar/rbenv/0.4.0/libexec:
    /Users/Me/.rbenv/plugins/rbenv-env/bin:
    /Users/Me/.rbenv/shims:
    /usr/local/heroku/bin:
    /usr/local/sbin:
    /usr/local/bin:
    /usr/local/share/npm/bin:
    /Applications/Atom.app/Contents/Resources/app/apm/bin:
    /Users/Me/.bin:
    /Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/bin:
    /usr/local/bin:/usr/bin:
    /bin:
    /usr/sbin:/sbin:
    /opt/X11/bin:
    /usr/local/MacGPG2/bin
  RBENV_DIR=/Users/Me/.rbenv/plugins
  </code></pre>
  
  <p>"<a href="https://stackoverflow.com/questions/29555478/brew-and-gem-both-throws-permission-denied-error-whenever-i-run-it">brew and gem both throws &#39;Permission denied&#39; error whenever I run it</a>" seems related though it was not solved except by using some other method which I may have to do.</p>