未定义的方法“doorkeeper_for”错误

undefined method `doorkeeper_for' error

我的 Api::Controller 中的 ActionController::RoutingError (undefined methoddoorkeeper_for'when I addeddoorkeeper_for :all` 出错了。这是我的示例控制器。我做错了什么?

class Api::UsersController < ApplicationController
  doorkeeper_for :all

  def index
    @users = User.all
  end
end

doorkeeper_for 方法已从 doorkeeper gem 中删除。相反,做:

before_action :doorkeeper_authorize!

要解决任何其他问题,请始终参考文档:https://github.com/doorkeeper-gem/doorkeeper