我已经在我的应用程序中设置了设计。我想添加omniauth-facebook gem(用于facebook身份验证)。该设置在开发和登台环境中运行良好,但在我的生产环境中出现以下错误:
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)
此警告似乎源自此设计文件。
我的宝石文件
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'
用户.rb
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :omniauthable,
:recoverable, :rememberable, :trackable, :validatable
end
在设计.rb
config.omniauth :facebook, OMNIAUTH_VAR['FACEBOOK_APP_ID'], OMNIAUTH_VAR['FACEBOOK_APP_SECRET'], scope: 'email'
将以下内容添加到devise.rb也不起作用
require 'omniauth-facebook'
require 'omniauth'
任何帮助将不胜感激。谢谢!