title: Ruby gem show "Invalid argument" error for almost every command
body: <p>I am working through NativeScript's set-up on <strong>OS X El Capitan</strong> and I am stuck at the point where I am supposed to install <code>xcodeproj</code> and <code>cocoapods</code>. Almost everything that I try to do with <code>gem</code> shows the same error:</p>
  
  <pre><code>$ sudo gem install xcodeproj
  ERROR:  While executing gem ... (Errno::EINVAL)
      Invalid argument
  </code></pre>
  
  <p>The following commands show the same error, wether I run it with <code>sudo</code> or not:</p>
  
  <pre><code>$ gem update --system
  $ gem update
  $ gem install whatever
  $ gem install cocoapods
  </code></pre>
  
  <p>I have the following versions:</p>
  
  <pre><code>$ ruby --version
  ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
  
  $ gem --version
  2.6.7
  </code></pre>
  
  <p>I've tried some of the help that I've found online, including reinstalling <code>gem</code> and <code>ruby</code>, restarting but nothing has helped.</p>
  
  <p>I guess that I have a configuration problem with Ruby.</p>
  
  <p>Any suggestions on how to troubleshoot this?</p>