title: Cannot getting devise omniauthable working
body: <p>I need to access google APIs, I'm trying to make users log in with their google account using Devise 2.1.1 and Omniauth (using the gem <code>google_oauth2</code> since OAuth2 is the reccomended one from google docs).</p>
  
  <p>Unfortunatly I cannot get it working, this is the <code>routes.rb</code></p>
  
  <pre><code>TestApp::Application.routes.draw do
    root :to =&gt; 'Landing#index'
  
    devise_for :users, :controllers =&gt; { :omniauth_callbacks =&gt; "users/omniauth_callbacks" }
  
    devise_scope :user do
      get 'sign_in', :to =&gt; 'users/sessions#new', :as =&gt; :new_session
      get 'sign_out', :to =&gt; 'users/sessions#destroy', :as =&gt; :destroy_session
    end
  end
  </code></pre>
  
  <p>Then I configured <code>config/initializers/devise.rb</code> to include a line with</p>
  
  <pre><code>  config.omniauth :google_oauth2, 'ID', 'SECRET', {access_type: 'offline', approval_prompt: 'force', scope: 'https://www.googleapis.com/auth/analytics.readonly'}
  </code></pre>
  
  <p>And actually I've a void callback class <code>app/controllers/users/omniauth_callbacks_controller.rb</code></p>
  
  <pre><code>class Users::OmniauthCallbacksController &lt; Devise::OmniauthCallbacksController
  end
  </code></pre>
  
  <p>When I click on "Sign in with Google" I got redirected on Google, asking for authorization, then I go back to the callback, and I get redirected on the URL <code>http://localhost:3000/sign_in.user</code>with the error</p>
  
  <pre><code>uninitialized constant Users::SessionsController
  </code></pre>
  
  <p>What's wrong here? I spent 2 day trying to figure out it by myself, I played with a lot of configurations but never get it working, it's starting frustrating me.</p>
  
  <p>This is the output from <code>rake routes</code></p>
  
  <pre><code>root     /                                      Landing#index
  user_omniauth_authorize     /users/auth/:provider(.:format)        users/omniauth_callbacks#passthru {:provider=&gt;/google_oauth2/}
  user_omniauth_callback     /users/auth/:action/callback(.:format) users/omniauth_callbacks#(?-mix:google_oauth2)
  new_session GET /sign_in(.:format)                     users/sessions#new
  destroy_session GET /sign_out(.:format)                    users/sessions#destroy    
  </code></pre>