为什么我在看门人中得到“声明无效”的错误?

qoefvg9y  于 2022-10-08  发布在  其他
关注(0)|答案(1)|浏览(100)

在我的Rails应用程序中使用DoorKeeper时,我收到了一个特殊的错误。下面是我的Doorkeeper.rb文件:

Doorkeeper.configure do
  # Change the ORM that doorkeeper will use (needs plugins)
  orm :active_record

  # This block will be called to check whether the resource owner is authenticated or not.
  resource_owner_authenticator do |routes|
    # Put your resource owner authentication logic here.
    # Example implementation:
    User.find_by_id(session[:user_id]) || redirect_to(routes.login_url)
  end

end

当我使用我的登录用户转到路由localhost:3000/oauth/authorize时,它抛出以下错误:

ActiveRecord::StatementInvalid in Doorkeeper::AuthorizationsController#new
    Could not find table oauth_application
    def table_structure(table_name)
      structure = exec_query("PRAGMA table_info(#{quote_table_name(table_name)})", 'SCHEMA')
      raise(ActiveRecord::StatementInvalid, "Could not find table '#{table_name}'") if structure.empty?
      table_structure_with_collation(table_name, structure)
    end

为什么会发生此错误?

sulc1iza

sulc1iza1#

我真傻!我忘记运行安装DoorKeeper时所需的迁移LOL

相关问题