I have devise already set up in my application. I want to add omniauth-facebook gem (for facebook authentication). The set up works fine in development and staging environments, but given me the following error in my production environment:
Could not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile.
/home/slaxman/apps/itextbook/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- omniauth (LoadError)
This warning seems to originate from this devise file.
My Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.11'
group :production do
gem 'pg', '0.14.1'
gem 'therubyracer','0.11.4'
gem 'execjs', '1.4.0'
end
group :assets do
gem 'sass-rails', '~> 3.2.6'
gem 'jquery-rails', '~> 2.2.1'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '~> 1.3.0'
gem 'bootstrap-sass', '~> 2.3.1.2'
gem 'bootswatch-rails', '~> 0.5.0'
end
gem 'unicorn', '~> 4.6.2'
gem 'capistrano', '~> 2.14.2'
gem "multi_json", "~> 1.2.0"
gem 'devise' , '~> 2.2.4'
gem 'omniauth-facebook', '1.4.0'
gem 'cancan', '~> 1.6.8'
gem 'omniauth', '>= 1.0.0'
user.rb
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :omniauthable,
:recoverable, :rememberable, :trackable, :validatable
end
In devise.rb
config.omniauth :facebook, OMNIAUTH_VAR['FACEBOOK_APP_ID'], OMNIAUTH_VAR['FACEBOOK_APP_SECRET'], scope: 'email'
Adding the following to devise.rb also does not work
require 'omniauth-facebook'
require 'omniauth'
Any help will be greatly appreciated. Thanks!