Ruby on rails Rails 4,授权问题

Ruby on rails Rails 4,授权问题,ruby-on-rails,devise,omniauth,declarative-authorization,warden,Ruby On Rails,Devise,Omniauth,Declarative Authorization,Warden,我正在使用Rails 4和Desive、warden、声明式授权和omniauth 当我运行rails服务器尝试测试我的初始设置时,我会收到一条错误消息,其中包含我的所有初始页面 当我键入go to localhost:3000时-我得到一个错误,显示“无效策略某些外部策略”,该错误将我指向应用程序控制器-使用以下方法: def set_current_user Authorization.current_user = current_user end 作为生成的脚手架的一部分,自动创建

我正在使用Rails 4和Desive、warden、声明式授权和omniauth

当我运行rails服务器尝试测试我的初始设置时,我会收到一条错误消息,其中包含我的所有初始页面

当我键入go to localhost:3000时-我得到一个错误,显示“无效策略某些外部策略”,该错误将我指向应用程序控制器-使用以下方法:

 def set_current_user
 Authorization.current_user = current_user
 end
作为生成的脚手架的一部分,自动创建的每个视图都会出现相同的错误

当我尝试导航到localhost:3000/home/index时,我得到了一个错误:“没有与[get]匹配的路由”/home/index

“我的路线”文件的第一行包含以下内容:

root :to => 'home#index'
我有一个home_controller.rb,其中包含以下代码:

class HomeController < ApplicationController

def index

end
end
class HomeController
如果您有任何关于如何解决此问题的想法或建议,我们将不胜感激


非常感谢。

据我所知,Devage gem适合身份验证而非授权。如果您想进行用户授权,我建议您使用CanCan gem而不是使用Devage。它是用于授权的简单高效的gem。

您是否修改了
配置/初始化器/devise.rb
?我在取消注释Warden配置部分时出现了相同的错误,其中包括以下几行:

config.warden do |manager|
    manager.intercept_401 = false
    manager.default_strategies(scope: :user).unshift :some_external_strategy
end