当我使用omniauth时遇到此错误,使用rails 3.1.3进行设计。我已经安装了omniauth gem和omniauth facebook。
按照指南将routes.rb配置为match '/auth/:provider/callback',to: 'authentications#create'
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
关于ruby-on-rails-3 - 没有路由匹配 [GET] "/auth/facebook",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8660280/