【问题标题】:Statement Invalid in DoorKeeper ErrorDoorKeeper 错误中的语句无效
【发布时间】:2016-11-27 04:33:30
【问题描述】:

在我的 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

谁能告诉我为什么会出现这个错误?非常感谢您的帮助。

【问题讨论】:

    标签: ruby-on-rails oauth-2.0 rails-api doorkeeper


    【解决方案1】:

    我傻了!我忘记运行安装门卫 LOL 时所需的迁移

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-23
      • 2012-01-14
      • 2011-01-21
      • 2021-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-14
      相关资源
      最近更新 更多