title: Devise (3.4.1 2f0002a), undefined method `flash' for ActionDispatch::Request, rails 4.2
body: <p>When I <code>sign up</code> or <code>sign in</code> using <code>devise</code>. I get following error:</p>
  
  <pre><code>undefined method `flash' for #&lt;ActionDispatch::Request:0xda424ac&gt;
  </code></pre>
  
  <p>This is my first project using <code>rails 4.2</code>, all previous projects had atmost <code>rails 4.1.8</code> and I never had similar issue.</p>
  
  <p>Error trace path is:</p>
  
  <pre><code>.../.rvmruby (2.1.2) bundler/gems/devise-2f0002a449a8/lib/devise/failure_app.rb:18:in `flash'
  .../.rvmruby (2.1.2) bundler/gems/devise-2f0002a449a8/lib/devise/failure_app.rb:58:in `redirect'
  .../.rvmruby (2.1.2) bundler/gems/devise-2f0002a449a8/lib/devise/failure_app.rb:39:in `respond'
  actionpack (4.2.0) lib/abstract_controller/base.rb:198:in `process_action'
  actionpack (4.2.0) lib/abstract_controller/base.rb:137:in `process'
  actionpack (4.2.0) lib/action_controller/metal.rb:195:in `dispatch'
  actionpack (4.2.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  </code></pre>
  
  <p>If you need any more information please say, I am stuck with this for some time.</p>
  
  <p>I have seen people having issues using <code>rails-api</code> gem, but I am not using <code>rails-api</code> gem.</p>
  
  <p>Thanks for all your help.</p>