title: Rbenv wrong gem installation path - can't find gem
body: <p>I'm having an issue with rbenv and what I believe is an issue is of <code>require</code>  trying to read from my system gems rather than from shims.</p>
  
  <p>I'm trying to create a single script file without the overhead of needing bundle - though I've tried adding a Gemfile and put the script and Gemfile in the same directory.</p>
  
  <p>Reproducible steps:</p>
  
  <ol>
  <li><code>brew install rbenv</code></li>
  <li><code>export PATH="$HOME/.rbenv/bin:$PATH"</code> in my <code>.zshrc</code></li>
  <li>Add <code>eval "$(rbenv init -)"</code> to my <code>.zshrc</code></li>
  <li>Source: <code>.  ~/.zshrc</code></li>
  <li><code>rbenv install 2.6.3</code></li>
  <li><code>rbenv rehash</code></li>
  <li><code>rbenv global 2.6.3</code></li>
  <li><code>rbenv rehash</code> for brevity</li>
  <li>Close terminal</li>
  <li>New terminal:
  
  <ul>
  <li><code>ruby -v</code> = "ruby 2.6.3p62"</li>
  <li><code>rbenv version</code> = "2.6.3 (set by $HOME/Desktop/.ruby-version)"</li>
  </ul></li>
  <li><code>which ruby</code> = "$HOME/.rbenv/shims/ruby"</li>
  <li><code>gem env</code>
  
  <ul>
  <li>INSTALLATION DIRECTORY: $HOME/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0</li>
  <li>USER INSTALLATION DIRECTORY: $HOME/.gem/ruby/2.6.0</li>
  <li>RUBY EXECUTABLE: $HOME/.rbenv/versions/2.6.3/bin/ruby</li>
  <li>EXECUTABLE DIRECTORY: $HOME/.rbenv/versions/2.6.3/bin</li>
  <li>SPEC CACHE DIRECTORY: $HOME/.gem/specs</li>
  <li>SYSTEM CONFIGURATION DIRECTORY: $HOME/.rbenv/versions/2.6.3/etc</li>
  <li>RUBYGEMS PLATFORMS:
  
  <ul>
  <li>ruby</li>
  <li>x86_64-darwin-18</li>
  </ul></li>
  <li>GEM PATHS:
  
  <ul>
  <li>$HOME/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0</li>
  <li>$HOME/.gem/ruby/2.6.0</li>
  </ul></li>
  </ul></li>
  <li><code>gem install colorize</code> - this gem seems to work fine</li>
  <li><code>gem install httparty</code></li>
  <li><code>gem install pry</code></li>
  <li><p>File header:</p>
  
  <pre><code>#!/usr/bin/ruby
  
  require 'httparty'
  require 'colorize'
  require 'pry'
  </code></pre></li>
  <li><code>./file.rb</code></li>
  <li>Stack Trace for HTTParty
  
  <pre><code>/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in 'to_specs': Could not find 'multi_xml' (&gt;= 0.5.2) among 17 total gem(s) (Gem::LoadError)
  Checked in 'GEM_PATH=$HOME/.gem/ruby/2.3.0:/Library/Ruby/Gems/2.3.0:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0', execute `gem env` for more information
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1442:in `block in activate_dependencies'
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1431:in `each'
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1431:in `activate_dependencies'
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1413:in `activate'
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:196:in `rescue in try_activate'
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:193:in `try_activate'
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:125:in `rescue in require'
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:39:in `require'
  from ./cdw-demo.rb:3:in `&lt;main&gt;'
  </code></pre></li>
  <li>Stack trace for Pry
  
  <pre><code>/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- pry (LoadError)
  from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  from ./cdw-demo.rb:4:in `&lt;main&gt;'
  </code></pre></li>
  </ol>
  
  <p>The stack trace shows there maybe in issue with <code>multi_xml</code> being a missing gem, but that was installed with <code>httparty</code></p>
  
  <p>Gem list:
  <code>gem list</code></p>
  
  <pre><code>*** LOCAL GEMS ***
  
  bigdecimal (default: 1.4.1)
  bundler (2.1.4, default: 1.17.2)
  cmath (default: 1.0.0)
  coderay (1.1.2)
  colorize (0.8.1)
  csv (default: 3.0.9)
  date (default: 2.0.0)
  dbm (default: 1.0.0)
  did_you_mean (1.3.0)
  e2mmap (default: 0.1.0)
  etc (default: 1.0.1)
  fcntl (default: 1.0.0)
  fiddle (default: 1.0.0)
  fileutils (default: 1.1.0)
  forwardable (default: 1.2.0)
  gdbm (default: 2.0.0)
  httparty (0.17.3)
  io-console (default: 0.4.7)
  ipaddr (default: 1.2.2)
  irb (default: 1.0.0)
  json (default: 2.1.0)
  logger (default: 1.3.0)
  matrix (default: 0.1.0)
  method_source (0.9.2)
  mime-types (3.3.1)
  mime-types-data (3.2019.1009)
  minitest (5.11.3)
  multi_xml (0.6.0)
  mutex_m (default: 0.1.0)
  net-telnet (0.2.0)
  openssl (default: 2.1.2)
  ostruct (default: 0.1.0)
  power_assert (1.1.3)
  prime (default: 0.1.0)
  pry (0.12.2)
  psych (default: 3.1.0)
  rake (12.3.2)
  rdoc (default: 6.1.0)
  rexml (default: 3.1.9)
  rss (default: 0.2.7)
  scanf (default: 1.0.0)
  sdbm (default: 1.0.0)
  shell (default: 0.7)
  stringio (default: 0.0.2)
  strscan (default: 1.0.0)
  sync (default: 0.5.0)
  test-unit (3.2.9)
  thwait (default: 0.1.0)
  tracer (default: 0.1.0)
  webrick (default: 1.4.2)
  xmlrpc (0.3.0)
  zlib (default: 1.0.0)
  </code></pre>
  
  <p>Let me know if anymore information is needed.</p>