最新的omniauth-facebook gem突破设计 [英] Latest omniauth-facebook gem breaks devise
问题描述
红宝石"2.6.3"gem'rails','〜>6.0.2','> = 6.0.2.1'
ruby '2.6.3' gem 'rails', '~> 6.0.2', '>= 6.0.2.1'
我正在使用最新的omniauth-facebook并一起设计宝石文件:宝石``设计''宝石'omniauth-facebook'
I'm using the latest omniauth-facebook and devise together Gemfile: gem 'devise' gem 'omniauth-facebook'
启动服务器时出现此错误:
Getting this error when starting the server:
/versions/2.6.3/lib/ruby/gems/2.6.0/gems/devise-4.7.3/lib/devise/omniauth.rb:12:in'':您正在使用旧的OmniAuth版本,请确保您已安装1.0.0.pr2版本或更高版本.(RuntimeError)
/versions/2.6.3/lib/ruby/gems/2.6.0/gems/devise-4.7.3/lib/devise/omniauth.rb:12:in `': You are using an old OmniAuth version, please ensure you have 1.0.0.pr2 version or later installed. (RuntimeError)
问题是,如果我尝试使用较旧的omniauth-facebook版本,则服务器可以运行,但Facebook身份验证会停止正常运行(例如,尽管有电子邮件,但仍失败了
The problem is that if I try to use older omniauth-facebook versions the server works but then the Facebook authentication stops working properly (e.g. fails including emails despite
范围:电子邮件",信息字段:电子邮件,名称"
scope: 'email', info_fields: 'email,name'
在devise.rb中.)
in devise.rb. )
我尝试了omniauth-facebook和devise的许多不同版本组合.Facebook身份验证无法正常工作或服务器出现故障(请参见上文).
I have tried many different version combinations of omniauth-facebook and devise. Either Facebook-authentication stops working properly or the server fails (see above).
推荐答案
使用
gem 'devise', github: 'heartcombo/devise', branch: 'ca-omniauth-2'
在Gemfile中,将解决此问题,等待合并.
In Gemfile will fix the problem, awaiting a merge.
根据下面的卡洛斯答案更新了我的答案,当我使用ref发布此信息时,我很着急.
Updated my answer based on Carlos answer below, I was in a rush when I posted this using ref.
谢谢卡洛斯(Carlos)维护Devise.
Thank You, Carlos for maintaining Devise.
这篇关于最新的omniauth-facebook gem突破设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!