fractaledmind / acidic_job

Elegant, resilient, durable workflows for Rails apps
https://fractaledmind.github.io/acidic_job/
MIT License
492 stars 10 forks source link

Uninitialized constant AcidicJob::ActiveKiq #86

Closed RomanTurner closed 1 year ago

RomanTurner commented 1 year ago

After following the prescribed setup, I keep running into the issue of Uninitialized constant AcidicJob::ActiveKiq when dealing with pure Sidekiq jobs.

I have created a small rails app for an example: You can clone it: https://github.com/RomanTurner/sidekiq-practice After cloning, you can run rails db:setup. This will create/migrate/seed for the database.

To find the error you can either travel to the route at localhost:3000/students/:id/example or in the rails console run: Students::PureSidekiqJob.perform_async(:student_id)

class Students::PureSidekiqJob < AcidicJob::ActiveKiq
  include Sidekiq::Job

  def perform(student_id)
    @student = Student.find(student_id)

    with_acidic_workflow do |workflow|
      workflow.step :student_says_hello
    end
  end

  def student_says_hello
    p "Student #{@student.first_name} #{@student.last_name} says 'Hello!'"
  end
end
ZiuzkinAliaksandr commented 1 year ago

Try to add: require 'acidic_job/active_kiq'

For me it solved the issue. Looks like this line with require is commented inside gem.

RomanTurner commented 1 year ago

Awesome,

This is working on my test project, but it does not like the argument forwarding shorthand (...) in my other application that is running ruby 2.7.2

AcidicJob::Base on the other hand works fine, so just going to update that when we make the push to ruby v 3+