简体   繁体   English

使用omniauth-google-oauth2 gem进行设计

[英]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.

相关问题 devise + omniauth-google-oauth2调用错误 - devise + omniauth-google-oauth2 calling errors 通过Devise和omniauth-google-oauth2注册新用户 - registration of new users with Devise and omniauth-google-oauth2 使用omniauth-google-oauth2图片大小的Rails设计不起作用 - Rails devise with omniauth-google-oauth2 image size does not work 在Rails 2.3.8和ruby 1.8.7中使用omniauth-google-oauth2 gem - Using omniauth-google-oauth2 gem in rails 2.3.8 and ruby 1.8.7 如何在Rails中使用具有增量授权的omniauth-google-oauth2 gem? - How to use omniauth-google-oauth2 gem with incremental authorization in Rails? Rails,使用omniauth-google-oauth2获取circledByCount - Rails, get circledByCount with omniauth-google-oauth2 在 rails API 中使用 omniauth-google-oauth2 - Using omniauth-google-oauth2 in rails API 通过 Ruby、Rails 和 'omniauth-google-oauth2'gem 访问 Google oath2 失败 - Google oath2 access via Ruby, Rails and 'omniauth-google-oauth2'gem failing 当我尝试使用omniauth-google-oauth2 gem进行身份验证时,没有路由匹配[GET]“/ auth / google_apps” - No route matches [GET] “/auth/google_apps” when I try to authenticate with omniauth-google-oauth2 gem 如何编写Rails 4测试以使用omniauth-google-oauth2 gem创建会话? - How can I write a Rails 4 test for creating a session with the omniauth-google-oauth2 gem?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM