我正在关注本教程:https ://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview
我的配置是:
宝石文件:
gem 'devise', '1.5'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2'
设计.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”行,服务器会正常启动。所以我认为这与这条线有关。
任何的想法?