title: uninitialized constant ApplicationController::CanCan (NameError) in production
body: <p>I've using nginx + unicorn at production </p>
  
  <p>And I've got following error at log/unicorn.log but it's work fine at localhost (in both environments development and production)</p>
  
  <pre><code>I, [2012-07-01T19:20:39.905978 #15422]  INFO -- : Refreshing Gem list
  E, [2012-07-01T19:20:40.526582 #15418] ERROR -- : uninitialized constant ApplicationController::CanCan (NameError)
  </code></pre>
  
  <p>for line </p>
  
  <pre><code>rescue_from CanCan::AccessDenied do |exception|
  </code></pre>
  
  <p>I have gem 'cancan' in <a href="https://github.com/ck3g/link_manager/blob/master/Gemfile#L20" rel="nofollow">Gemfile</a> (below gem 'rails'). Cancan gem is installed. I've tried both versions 1.6.7 and 1.6.8</p>
  
  <pre><code>current$ bundle exec gem list cancan
  
  *** LOCAL GEMS ***
  
  cancan (1.6.7)
  
  current$ bundle exec rails -v
  Rails 3.2.3
  
  current$ ruby -v
  ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
  
  current$ bundle exec rails c production
  Loading production environment (Rails 3.2.3)
  1.9.3p125 :001 &gt; CanCan
   =&gt; CanCan 
  1.9.3p125 :002 &gt; 
  </code></pre>
  
  <p>What can be wrong with my configuration?</p>
  
  <p><strong>upd:</strong> 
  <code>require 'cancan'</code> in <code>application_controller</code> cause error <code>No such file to load -- cancan (LoadError)</code></p>
  
  <p><a href="https://github.com/ck3g/link_manager/blob/master/Gemfile#L20" rel="nofollow">My Gemfile</a></p>