Ruby on rails 无法自动加载常量JWTBlacklist,应为/home/sourabh/dev/celluation/app/models/jwt_blacklist.rb以定义它(LoadError)

Ruby on rails 无法自动加载常量JWTBlacklist,应为/home/sourabh/dev/celluation/app/models/jwt_blacklist.rb以定义它(LoadError),ruby-on-rails,devise,jwt,Ruby On Rails,Devise,Jwt,my user.rb模型包含: class User < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable, :lockable, :timeoutable, :omniauthable, :jwt_authent

my user.rb模型包含:

class User < ApplicationRecord

  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :confirmable, :lockable, :timeoutable, :omniauthable,
         :jwt_authenticatable, jwt_revocation_strategy: JWTBlacklist

  def send_devise_notification(notification, *args)
    devise_mailer.send(notification, self, *args).deliver_later
  end
end
class JwtBlacklist < ApplicationRecord
  include Devise::JWT::RevocationStrategies::Blacklist

  self.table_name = 'jwt_blacklist'
end
class用户
我正在使用Desive jwt gem登录我的rails api

我的JWTBlacklist.rb模型包含:

class User < ApplicationRecord

  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :confirmable, :lockable, :timeoutable, :omniauthable,
         :jwt_authenticatable, jwt_revocation_strategy: JWTBlacklist

  def send_devise_notification(notification, *args)
    devise_mailer.send(notification, self, *args).deliver_later
  end
end
class JwtBlacklist < ApplicationRecord
  include Devise::JWT::RevocationStrategies::Blacklist

  self.table_name = 'jwt_blacklist'
end
class jwt黑名单
您的
用户
类正在查找
jwt黑名单
,但您的文件正在定义
jwt黑名单
。您需要更改其中一个以匹配另一个