title: Bundler failing with - require': no such file to load -- bundler
body: <p>I have a centOS server from work, that came with ruby 1.8.7 needed for puppet as far as I was told, I am working in a Sinatra app that requires ruby 1.9+ as per my works devops team, they refused to use RVM or rbenv, and were adamant on keeping 1.8.7 for puppet, so they installed 1.9.3 from source in </p>
  
  <pre><code>/opt/ruby-1.9.3/bin/ruby
  </code></pre>
  
  <p>For my user I had to create a few aliases in my .bash_profile</p>
  
  <pre><code>alias ruby="/opt/ruby-1.9.3/bin/ruby"
  alias gem="/opt/ruby-1.9.3/bin/gem"
  alias erb="/opt/ruby-1.9.3/bin/erb"
  alias bundle="/opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/bin/bundle"
  alias rackup="/opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/bin/rackup"
  </code></pre>
  
  <p>ruby worked, gem also, but never bundler or rackup, I had to install my Sinatra app dependencies with plain gem install, which was ok for me.</p>
  
  <p>But now that I want to serve the app thru apache with passenger (mod_rails), I get errors about not found gems, this for example:</p>
  
  <pre><code>Could not find nokogiri-1.5.9 in any of the sources (Bundler::GemNotFound)
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `&lt;top (required)&gt;'
    /opt/ruby-1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    /opt/ruby-1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    /opt/ruby-1.9.3/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-4.0.5/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:73:in `preload_app'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:127:in `&lt;module:App&gt;'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:6:in `&lt;module:PhusionPassenger&gt;'
    /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:5:in `&lt;main&gt;'
  </code></pre>
  
  <p>When I try to use bundler, I get this error:</p>
  
  <pre><code>$ bundle install
  /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:7:in `require': no such file to load -- bundler (LoadError)
      from /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:7
  </code></pre>
  
  <p>the contents of the file in line 7 is:</p>
  
  <pre><code>require 'bundler'
  </code></pre>
  
  <p>Any clues? thanks in advance! </p>