Skip to content

"uninitialized constant GoodJob::Execution" in development env #634

Closed
@doits

Description

Trying to enqueue Rails' job in development mode:

TestJob.perform_later

... gives:

Failed enqueuing TestJob to GoodJob(default): NameError (uninitialized constant GoodJob::Execution

      execution = GoodJob::Execution.enqueue(
                         ^^^^^^^^^^^
Did you mean?  Exception)
/.../.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-2.17.0/lib/good_job/adapter.rb:72:in `enqueue_at': uninitialized constant GoodJob::Execution (NameError)

      execution = GoodJob::Execution.enqueue(
                         ^^^^^^^^^^^
Did you mean?  Exception

To fix it I can do a require 'good_job/execution'. Looks like autoloader does not catch it?

  • Happens on GoodJob 2.17.
  • 2.16.1 works fine.
  • Production and Test env are not affected, seems like only development
  • Rails 7.0.3
  • Ruby 3.1.2

Can you reproduce it? I'll provide more details if you need them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions