title: Ruby gems install vs. runtime path on OSX
body: <p><strong>Where's the mismatch between gem install path and used Rakefile path?</strong></p>
  
  <p>I originally wanted to run a Rakefile on my Mac OS X Mountain Lion 10.8.4.
  That failed on a missing 'open4' package.</p>
  
  <p>I have no experience with ruby and little with Mac, but I googled open4 and found:</p>
  
  <pre><code>gem install open4
  </code></pre>
  
  <p>That also failed, but with sudo it succeeded.</p>
  
  <p>It still didn't work though and my conclusion is that the install path:</p>
  
  <pre><code>/Library/Ruby/Gems/1.8
  </code></pre>
  
  <p>is different from the runtime include path, which I dumped from the script:</p>
  
  <pre><code>/Library/Ruby/Site/1.8
  /Library/Ruby/Site/1.8/powerpc-darwin12.0
  /Library/Ruby/Site/1.8/universal-darwin12.0
  /Library/Ruby/Site
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/universal-darwin12.0
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin12.0
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0
  </code></pre>
  
  <p>More googling led me to stackoverflow <a href="https://stackoverflow.com/questions/6671318/understanding-rubys-load-paths">understanding-rubys-load-paths</a> and <a href="https://stackoverflow.com/questions/8548809/pg-gem-install-on-mac-os-lion-with-rvm">more</a>.
  They all seem to conclude the solution is <a href="http://rvm.io/" rel="nofollow noreferrer">RVM</a> (links to RVM were broken)</p>
  
  <p>I installed that:</p>
  
  <pre><code>sudo curl -L https://get.rvm.io | bash
  </code></pre>
  
  <p>But the path used by RVM was no better:</p>
  
  <pre><code>$ rvm gemdir
  /Library/Ruby/Gems/1.8
  </code></pre>
  
  <p>A <a href="https://stackoverflow.com/questions/1064065/gem-path-used-by-rake-different-than-system-path-on-os-x">very old question - gem-path-used-by-rake-different-than-system-path-on-os-x</a> seems to cover what I want to know, but the solution doesn't seem relevant on current OSX</p>
  
  <p>Where's the mismatch between install and used path?</p>