title: How do I ensure ruby gems are installed in right place to be executed by bundler?
body: <p>I seem to be constantly having problems with getting the gems in the right place (and not needing to use <code>sudo</code> when installing them.)</p>
  
  <p>To address the <code>sudo</code> issue, I installed <code>rbenv</code> and then use that to install ruby 2.1.0 so that I had a separate one from Mac OSX system.</p>
  
  <p>Then I installed bundler.  But when I install gems from a Gemfile with bundler, I cannot find them.</p>
  
  <p>Between all the steps I have taken, such as adding lines to my .bash_profile and so forth, I have the following, but really just want a clear, straightforward way to manage gems and their local execution:</p>
  
  <p><code>gem env</code> :</p>
  
  <p><strong>Edit: I removed everything and reset PATH -- still didn't fix anything, but you can see that gems are installed in one directory but when I call the executable, the command cannot be found:</strong></p>
  
  <pre><code> RubyGems Environment:
    - RUBYGEMS VERSION: 2.0.14
    - RUBY VERSION: 2.0.0 (2014-02-24 patchlevel 451) [universal.x86_64-darwin13]
    - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
    - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    - EXECUTABLE DIRECTORY: /usr/bin
    - RUBYGEMS PLATFORMS:
      - ruby
      - universal-darwin-13
    - GEM PATHS:
       - /Library/Ruby/Gems/2.0.0
       - /Users/fongster/.gem/ruby/2.0.0
       - /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0
  </code></pre>
  
  <p>Here is what happens when I want to run, say <code>shotgun</code>:</p>
  
  <p><code>bash-3.2$ shotgun
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in</code>to_specs': Could not find 'shotgun' (>= 0) among 12 total gem(s) (Gem::LoadError)</p>
  
  <p>Can someone point me to simple, straightforward directdions for ruby gem management on OSX so that:</p>
  
  <ul>
  <li>I don't need to use <code>sudo</code> to install gems</li>
  <li>I can use bundler to install from a Gemfile for a given project</li>
  <li>Those gems and their executables (shotgun, restclient, sass) can just be executed</li>
  <li>My local environment based on this set up 'just works' in heroku?</li>
  <li>I don't need to type <code>bundle exec</code> when I need to do stuff</li>
  </ul>
  
  <p>Also some clarity on whether I need to always go to a bash shell (currently, I have been using <code>exec bash</code> to get my shell working).</p>
  
  <p>EDIT:  Following the steps below and have this response upon bundle:</p>
  
  <pre><code>Errno::EEXIST: File exists @ dir_s_mkdir - /Users/fongster/.rbenv/shims/gem
  An error occurred while installing backports (3.6.3), and Bundler cannot
  continue.
  Make sure that `gem install backports -v '3.6.3'` succeeds before bundling.
  </code></pre>