Rails 5设计omniauth-facebook错误:抱歉,出了点问题

我正在按照Devise的官方指南从顶部到本节 。 我的CALLBACK_URLhttp://localhost:3000/users/auth/facebook/callback ,我认为这可能是问题,但我不确定。 当我点击登录Facebook时,我遇到了这个错误:
抱歉,出了一些问题。
在这个链接上:
https://www.facebook.com/v2.6/dialog/oauth?client_id=193217371133539&redirect_uri=https%3A%2F%2Flocalhost%3A3000%2Fusers%2Fauth%2Ffacebook%2Fcallback&response_type=code&scope=user%2Cpublic_repo&state=3913c12e0e4ce8b422732c9159c0fb1fb7351d100487849d

Rails版本:Rails 5.0.0.1
Ruby版本(使用rbenv):ruby 2.3.1p112(2016-04-26修订版54768)[x86_64-darwin16]

对于仍有此问题的人,请检查您的范围,如上面的Akash和Bodacious状态,并将其修改为如下所示:

 scope: 'email', info_fields: 'email,name' 

这将允许您获取电子邮件字段。

我找到了这个https://github.com/plataformatec/devise/wiki/OmniAuth:-概述

Facebook返回无效的电子邮件

自2015年7月8日Facebook更改为api v2.4后,您需要添加额外的info_fields以获取电子邮件字段。

 config.omniauth :facebook, "APP_ID", "APP_SECRET", scope: 'email', info_fields: 'email,name' 

@techmonster从这里找到了解决方案