在我的开发环境中,我遇到了这个错误 :
我的文件夹结构如下:
WARN: LoadError: Unable to autoload constant Alerts::FailedReportWorker, expected /my-path/app/workers/alerts/failed_report_worker.rb to define it.
我在我的schedule.yml文件中有这些工作者:
alert_sla_worker:
cron: "*/1 * * * *"
class: "Alerts::SlaWorker"
alert_failed_export_worker:
cron: "*/1 * * * *"
class: "Alerts::FailedExportWorker"
alert_failed_report_worker:
cron: "*/1 * * * *"
class: "Alerts::FailedReportWorker"
alert_failed_extractor_worker:
cron: "*/1 * * * *"
class: "Alerts::FailedExtractorWorker"
我的文件夹结构如下:
workers
alerts(folder)
failed_export_worker.rb
failed_extractor_worker.rb
failed_report_worker.rb
sla_worker.rb
并且 failed_report_worker.rb :
# frozen_string_literal: true
module Alerts
class FailedReportWorker
include Sidekiq::Worker
sidekiq_options queue: :default, retry: 0
def perform
...
end
end
end
我该如何解决这个问题?我不确定我缺少了什么!
failed_report_worker.rb
是什么样子? - Roman Alekseievworkers
文件夹位于哪里?就在app
下面吗? - Olkin