9
votes

I have watched railscast http://railscasts.com/episodes/236-omniauth-part-2

And tried to implement the code, everything worked well in development environment. when I executed using rails s -e production, I get the error below

omniauth_callbacks_controller.rb:1: uninitialized constant Devise::OmniauthCallbacksController (NameError)

The code snippet that caused error is here

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController

My Gemfile


gem 'aws-s3'
gem 'paperclip'
gem 'rails', '3.0.0'
gem 'pg'
gem 'gravatar_image_tag', '0.1.0'
gem 'will_paginate', '3.0.pre2'
gem 'devise'
gem 'omniauth'
gem 'nifty-generators'

My Gemfile.lock file (just related ones)


    devise (1.1.5)
      bcrypt-ruby (~> 2.1.2)
      warden (~> 1.0.2)

    nokogiri (1.4.4)
    oa-basic (0.1.6)
      multi_json (~> 0.0.2)
      nokogiri (~> 1.4.2)
      oa-core (= 0.1.6)
      rest-client (~> 1.6.0)
    oa-core (0.1.6)
      rack (~> 1.1)
    oa-enterprise (0.1.6)
      net-ldap (~> 0.1.1)
      nokogiri (~> 1.4.2)
      oa-core (= 0.1.6)
      pyu-ruby-sasl (~> 0.0.3.1)
      rubyntlm (~> 0.1.1)
    oa-oauth (0.1.6)
      multi_json (~> 0.0.2)
      nokogiri (~> 1.4.2)
      oa-core (= 0.1.6)
      oauth (~> 0.4.0)
      oauth2 (~> 0.1.0)
    oa-openid (0.1.6)
      oa-core (= 0.1.6)
      rack-openid (~> 1.2.0)
      ruby-openid-apps-discovery
    oauth (0.4.4)
    oauth2 (0.1.0)
      faraday (~> 0.5.0)
      multi_json (~> 0.0.4)
    omniauth (0.1.6)
      oa-basic (= 0.1.6)
      oa-core (= 0.1.6)
      oa-enterprise (= 0.1.6)
      oa-oauth (= 0.1.6)
      oa-openid (= 0.1.6)

My development.rb file


SampleApp::Application.configure do
  config.cache_classes = false
  config.whiny_nils = true
  config.consider_all_requests_local       = true
  config.action_view.debug_rjs             = true
  config.action_controller.perform_caching = false
  config.action_mailer.raise_delivery_errors = false
  config.active_support.deprecation = :log
  config.action_dispatch.best_standards_support = :builtin
  config.action_mailer.default_url_options = { :host => 'localhost:3000' }
end

My production.rb file


SampleApp::Application.configure do
  config.cache_classes = true
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  config.action_dispatch.x_sendfile_header = "X-Sendfile"
  config.serve_static_assets = false
  config.i18n.fallbacks = true
  config.active_support.deprecation = :notify
end

Can anyone help?

2

2 Answers

5
votes

In devise 1.2, it's supports integration with OmniAuth directly.

Check devise wiki for OmniAuth

1
votes

What's your Gemfile look like? Did you stick the gem 'omniauth' statement in a :development group by any chance?