title: Devise Helpers (authenticate_user!, current_user, user_signed_in?) not initialized
body: <p>I am setting up devise and need to be able to use devise helpers. 
  When I add       <code>before_filter :authenticate_user!</code> into the application controller I get the following error <code>undefined method 'authenticate_user!' for #&lt;HomeController:*&gt;</code></p>
  
  <p>It is not present in my home controller directly, but inherited from the application controller, if I use <code>skip_before_filter :authenticate_user!</code> in my home (or any controller) and try to access the page  I get the following error. </p>
  
  <pre><code>undefined method `user_signed_in?' for #&lt;#&lt;Class *&gt;
  </code></pre>
  
  <p>It breaks on the line that in the layouts/application.html.erb file that calls it. The same things happens for any of the helpers. It looks as if they are not being loaded at all, however, when I loaded up the rails console, and entered <code>$LOAD_PATH.dup</code> the output included</p>
  
  <pre><code> "/usr/local/rvm/gems/ruby-1.9.3-p429/gems/devise-2.2.4/lib", "/usr/local/rvm/gems/ruby-1.9.3-p429/gems/devise-2.2.4/app/controllers", "/usr/local/rvm/gems/ruby-1.9.3-p429/gems/devise-2.2.4/app/helpers", "/usr/local/rvm/gems/ruby-1.9.3-p429/gems/devise-2.2.4/app/mailers" 
  </code></pre>
  
  <p>So it seems that they should indeed be loaded by rails.         </p>
  
  <p>This is my application controller </p>
  
  <blockquote>
    <p>class ApplicationController &lt; ActionController::Base  </p>
    
    <blockquote>
      <p>helper :all # include all helpers, all the time<br>
      protect_from_forgery<br>
      include ActionView::Helpers::NumberHelper<br>
      before_filter :authenticate_user!  </p>
    </blockquote>
    
    <p>end</p>
  </blockquote>
  
  <p>I did restart the server after installing devise, and multiple times as I tried different attempts to solve the problem. 
  If any more files or information is needed please let me know. Thank you very much in advance. </p>
  
  <p>Edit: My user.rb file was requested to show that I have indeed installed devise </p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  
    # Include default devise modules. Others available are:
    # :token_authenticatable, :confirmable,
    # :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable,
           :encryptable, :encryptor =&gt; :restful_authentication_sha1  
  
    # Setup accessible (or protected) attributes for your model  
    attr_accessible :email, :password, :password_confirmation, :remember_me  
  
  end
  </code></pre>
  
  <p>Edit: The entire error message </p>
  
  <blockquote>
    <p>NoMethodError in HomeController#index</p>
    
    <p>undefined method `authenticate_user!' for #&lt; HomeController:0x000000040c45a0 > '</p>
  </blockquote>
  
  <p>Here is the full trace</p>
  
  <blockquote>
    <p>activesupport (3.2.13) lib/active_support/callbacks.rb:418:in   `<em>run</em>_2094683035699451847__process_action_<em>2229546931289158113</em>_callbacks'</p>
    
    <p>activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'</p>
    
    <p>activesupport (3.2.13) lib/active_support/callbacks.rb:385:in >`_run_process_action_callbacks'</p>
    
    <p>activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'</p>
    
    <p>actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'</p>
    
    <p>actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'</p>
    
    <p>actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'</p>
    
    <p>activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'</p>
    
    <p>activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'</p>
    
    <p>activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'</p>
    
    <p>actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action'</p>
    
    <p>actionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'</p>
    
    <p>actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'</p>
    
    <p>actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'</p>
    
    <p>actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'</p>
    
    <p>actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'</p>
    
    <p>actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'</p>
    
    <p>journey (1.0.4) lib/journey/router.rb:68:in `block in call'</p>
    
    <p>journey (1.0.4) lib/journey/router.rb:56:in `each'</p>
    
    <p>journey (1.0.4) lib/journey/router.rb:56:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'</p>
    
    <p>warden (1.2.1) lib/warden/manager.rb:35:in `block in call'</p>
    
    <p>warden (1.2.1) lib/warden/manager.rb:34:in `catch'</p>
    
    <p>warden (1.2.1) lib/warden/manager.rb:34:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'</p>
    
    <p>rack (1.4.5) lib/rack/etag.rb:23:in `call'</p>
    
    <p>rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call'</p>
    
    <p>rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'</p>
    
    <p>rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'</p>
    
    <p>activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'</p>
    
    <p>activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'</p>
    
    <p>activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `<em>run</em>_177144612565476380_<em>call</em>_4534346825225857812__callbacks'</p>
    
    <p>activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'</p>
    
    <p>activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'</p>
    
    <p>activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'</p>
    
    <p>railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'</p>
    
    <p>railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'</p>
    
    <p>activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'</p>
    
    <p>railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'</p>
    
    <p>rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'</p>
    
    <p>rack (1.4.5) lib/rack/runtime.rb:17:in `call'</p>
    
    <p>activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'</p>
    
    <p>rack (1.4.5) lib/rack/lock.rb:15:in `call'</p>
    
    <p>actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'</p>
    
    <p>railties (3.2.13) lib/rails/engine.rb:479:in `call'</p>
    
    <p>railties (3.2.13) lib/rails/application.rb:223:in `call'</p>
    
    <p>railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'</p>
    
    <p>passenger (4.0.2) lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'</p>
    
    <p>passenger (4.0.2) lib/phusion_passenger/request_handler/thread_handler.rb:135:in `accept_and_process_next_request'</p>
    
    <p>passenger (4.0.2) lib/phusion_passenger/request_handler/thread_handler.rb:106:in `main_loop'</p>
    
    <p>passenger (4.0.2) lib/phusion_passenger/request_handler.rb:449:in `block (4 levels) in start_threads'</p>
    
    <p>passenger (4.0.2) lib/phusion_passenger/utils/robust_interruption.rb:108:in `disable_interruptions'</p>
    
    <p>passenger (4.0.2) lib/phusion_passenger/request_handler.rb:444:in `block (3 levels) in start_threads'</p>
  </blockquote>
  
  <p>Edit: This is the the text from running Devise.helpers in the console. </p>
  
  <blockquote>
    <p>$ rails console</p>
    
    <p>Loading development environment (Rails 3.2.13)</p>
    
    <p>1.9.3-p429 :001 > Devise.helpers</p>
    
    <p>=> #&lt; Set: {Devise::Controllers::Helpers} ></p>
  </blockquote>
  
  <p>Edit: This my routes rb file. 
      :Application.routes.draw do  </p>
  
  <pre><code>devise_for :users  
  
  resource :sessions, :only =&gt; [:new, :create, :destroy]
  
  devise_scope :user do
      match 'signup' =&gt; 'users#new', :as =&gt; :signup
      match 'register' =&gt; 'users#create', :as =&gt; :register
      match '/login' =&gt; 'sessions#new', :as =&gt; :login 
       match 'logout' =&gt; 'sessions#destroy', :as =&gt; :logout
  end
  match '/activate/:activation_code' =&gt; 'users#activate', :as =&gt; :activate, :activation_code =&gt; nil
  
  match '/users/:id', :to =&gt; 'users#show', :as =&gt; :user
  
  resources :users do
  
  member do
       put :suspend
       put :unsuspend
       delete :purge
  end
  
  end
  
  resource :sessions
  
     other resources
  
  match '' =&gt; 'home#index', :as =&gt; :home
  match ':controller(/:action(/:id))'
  root to: 'home#index'
  end 
  </code></pre>