加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails-3 – 没有路由匹配[GET]“/ auth / facebook”

发布时间:2020-12-16 22:49:24 所属栏目:百科 来源:网络整理
导读:当我使用omniauth时,我得到了这个错误,设计了rails 3.1.3.我已经安装了omniauth gem omn??iauth脸书. 将routes.rb配置为匹配’/ auth /:provider / callback’,以:’authentications #create’asper the guide https://github.com/intridea/omniauth 每当
当我使用omniauth时,我得到了这个错误,设计了rails 3.1.3.我已经安装了omniauth gem& omn??iauth脸书.

将routes.rb配置为匹配’/ auth /:provider / callback’,以:’authentications #create’asper the guide https://github.com/intridea/omniauth

每当我浏览网址http://localhost:3003/auth/facebook/时,我发现路由错误

**No route matches [GET] "/auth/facebook"**

请帮忙.我在stackoverflow中有相关的帖子,似乎都没有工作

解决方法

使用Rails 3.2,OmniAuth 1.0.2和Devise 2.0时遇到了同样的问题.

显然’path_prefix’存在问题.但是当手动重新配置时一切正常.

尝试在初始化程序中执行此操作:

Rails.application.config.middleware.use OmniAuth::Builder do
  configure do |config|
    config.path_prefix = '/auth'
  end
  ...
end

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读