title: Why is production rails ignoring gems installed by bundler?
body: <p>I am using capistrano to deploy a rails application to production. Everything appears to work and capistrano does not report any errors however the application fails to start with the following error message </p>
  
  <pre>
  Ruby (Rack) application could not be started 
  Could not find activemodel-3.2.0 in any of the sources (Bundler::GemNotFound)
  </pre>
  
  <p>When examining the bundled gems the correct version of gems are in the shared folder but passenger does not appear to be using them. Summarised output from cap deploy is as follows </p>
  
  <pre><code>  * executing "cd /opt/geonovo/retail/releases/20120628125205 &amp;&amp; \
      bundle install --gemfile /opt/geonovo/retail/releases/20120628125205/Gemfile \
      --path /opt/geonovo/retail/shared/bundle --deployment \
      --without development test"
      servers: ["rt-devrails01"]
      [rt-devrails01] executing command
   ** [out :: rt-devrails01] Fetching source index for http://rubygems.org/
   ** [out :: rt-devrails01] Using activesupport (3.2.0)
   ** [out :: rt-devrails01] 
   ** [out :: rt-devrails01] Using builder (3.0.0)
   ** [out :: rt-devrails01] 
   ** [out :: rt-devrails01] Installing activemodel (3.2.0)
   ...
   ...
   * [out :: rt-devrails01] 
   ** [out :: rt-devrails01] Your bundle is complete! 
   It was installed into /opt/geonovo/retail/shared/bundle
   command finished in 47529ms
  </code></pre>
  
  <p>running <code>gem list</code> on the production server does not show the activemodel 3.2.0 gem being present but the shared directory /opt/geonovo/retail/shared/bundle/ruby/1.9.1/gems/ does include an entry for activemodel-3.2.0.</p>
  
  <p>The production servers /bundle/config file contains the following</p>
  
  <pre>
  --- 
  BUNDLE_FROZEN: "1"
  BUNDLE_PATH: /opt/geonovo/retail/shared/bundle
  BUNDLE_DISABLE_SHARED_GEMS: "1"
  BUNDLE_WITHOUT: development:test
  </pre>
  
  <p>Running <code>bundle check</code> on the production server shows the following</p>
  
  <pre>
  The following gems are missing
   * activemodel (3.2.0)
   * actionpack (3.2.0)
   * actionmailer (3.2.0)
   * activerecord (3.2.0)
   * activeresource (3.2.0)
   * railties (3.2.0)
   * rails (3.2.0)
  Install missing gems with `bundle install`
  </pre>
  
  <p>I could probably install the gems using <code>bundle install</code> but I want the deploy to happen within capistrano if possible.</p>
  
  <p>The beginning of the Gemfile includes the following lines</p>
  
  <pre>
  source 'http://rubygems.org'
  
  gem 'rails', '>= 3.2.0'
  
  </pre>