[英]Devise with omniauth-google-oauth2 gem
I'm following this tutorial: https://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview 我正在关注本教程: https : //github.com/plataformatec/devise/wiki/OmniAuth%3A-概述
My configs are: 我的配置是:
Gemfile: 宝石文件:
gem 'devise', '1.5'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2'
devise.rb: 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"
But when I start server I get this error: 但是,当我启动服务器时,出现此错误:
/.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)
It works with Facebook but not with Google Oauth2 gem. 它适用于Facebook,但不适用于Google Oauth2 gem。
PS: If I remove the "config.omniauth :google_oauth2" line the server starts normally. PS:如果删除“ config.omniauth:google_oauth2”行,则服务器将正常启动。 So I think it's something with this line.
所以我认为这句话是有道理的。
Any idea? 任何想法?
通过将Devise从1.5更新到1.5.3解决了该问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.