Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI engine does not work without explicit require #646

Closed
morgoth opened this issue Jun 27, 2022 · 1 comment · Fixed by #654
Closed

UI engine does not work without explicit require #646

morgoth opened this issue Jun 27, 2022 · 1 comment · Fixed by #654

Comments

@morgoth
Copy link
Collaborator

morgoth commented Jun 27, 2022

I can see that by #554 it should no longer be required to add require "good_job/engine" line, but it does not work for me in development environment.

When visiting mounted "/good_job" path I'm getting:
uninitialized constant GoodJob::JobsController Object.const_get(camel_cased_word)
It's the same error on 2.99 and 3.0 versions

ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
bundle exec rails -v
Rails 7.0.3
@bensheldon bensheldon changed the title UI eninge does not work without explicit require UI engine does not work without explicit require Jun 27, 2022
@bensheldon
Copy link
Owner

Nuts! There shouldn't be any harm in adding back in require "good_job/engine".

I wish I knew how to diagnose why some Rails apps are able to implicitly autoload engines... and some aren't. The two commands I was using to debug that feature in #634 were:

  • bin/rails zeitwerk:check, which hopefully should output "All is good!"
  • bin/rails runner 'pp ActiveSupport::Dependencies.autoload_paths' which should include GoodJob's app/... files. e.g. Screen Shot 2022-06-27 at 7 22 51 AM

I think I should re-add the require 'good_job/engine' to the Readme as an optional suggestion. It shouldn't be required, but I bet you're not the only person experiencing problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants