我正在关注本教程:https://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview
我的配置是:
的Gemfile:
gem 'devise', '1.5'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2'
devise.rb:
require 'omniauth-google-oauth2'
config.omniauth :google_oauth2, "APP_ID", "APP_SECRET", { access_type: "offline", approval_prompt: "" }
require "omniauth-facebook"
config.omniauth :facebook, "APP-ID", "APP-Secret"
但是当我启动服务器时,我收到了这个错误:
/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.12/lib/active_support/dependencies.rb:242:in `require': no such file to load -- omniauth-google_oauth2 (LoadError)
适用于Facebook,但不适用于Google Oauth2 gem。
PS:如果我删除“config.omniauth:google_oauth2”行,服务器将正常启动。所以我认为这就是这条线。
有什么想法吗?
答案 0 :(得分:1)
通过将Devise从1.5更新为1.5.3来解决问题