-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Clockwork on Heroku is failing to load #83
Comments
From the description, I guess your application has If that is right, you have two options:
|
Yea I have the following in
BTW, I renamed |
Oh, yes, if renaming the file is an option, that solves the problem too. Regarding code organization, it all depends on the contents. Question is: Should all Otherwise, since I have also seen The important bit is that if Zeitwerk is managing some particular directory, its (non-ignored) file and directory names should match the constants they define. Not doing that is an error condition. |
Hey @kapso, do you think we can close this one? |
I like to keep issues and PRs to 0 in this project. Since the original issue showed a mismatch in the file name and that has been solved, I believe we can close. However, please feel free to followup if you'd like to discuss more about code organization. |
Clockwork Gem - https://github.com/Rykian/clockwork
Getting this error -
! Unable to load application: NameError: expected file /app/lib/clock.rb to define constant Clock, but didn't
My
clock.rb
is inside -/APP_ROOT/lib/clock.rb
, and not in/APP_ROOT/app/lib/clock.rb
This is my environment on Heroku -
Detailed Error -
Adding more info here -
This issue is fixed if I use
classic
autoloader as suggested here - https://weblog.rubyonrails.org/2019/2/22/zeitwerk-integration-in-rails-6-beta-2/config.autoloader = :classic
Also,
I have the following in
application.rb
-config.eager_load_paths += %W[#{config.root}/lib]
The text was updated successfully, but these errors were encountered: