question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecation warning when using it with Zeitwerk/Rails 6

See original GitHub issue

When I use effective_datatables with Zeitwerk/Rails 6 I’ll get the following error

DEPRECATION WARNING: Initialization autoloaded the constant ActsAsArchived.

Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.

Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload ActsAsArchived, for example,
the expected changes won't be reflected in that stale Module object.

This autoloaded constant has been unloaded.

Please, check the "Autoloading and Reloading Constants" guide for solutions.

Any solution for this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
matt-riemercommented, Aug 11, 2020

Okay thanks for the info! I will dig into this in the next day or so 😃

On Tue., Aug. 11, 2020, 8:19 a.m. Vincent van Andel, < notifications@github.com> wrote:

Hey, I’m already using effective_resources 1.4.13. That is the lastest right? (I’ve installed it as a dependency of the effective_datatables 4.8.5)

When I run rails zeitwerk:check I get the following error

Hold on, I am eager loading the application.

WARNING: The following directories will only be checked if you configure them to be eager loaded:

/.rvm/gems/ruby-2.6.6/gems/effective_resources-1.4.13/lib/ /.rvm/gems/ruby-2.6.6/gems/effective_resources-1.4.13/app/models/validators/ /.rvm/gems/ruby-2.6.6/gems/effective_resources-1.4.13/app/controllers/concerns/

You may verify them manually, or add them to config.eager_load_paths in config/application.rb and run zeitwerk:check again.

Otherwise, all is good!

Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/code-and-effect/effective_datatables/issues/136#issuecomment-671975270, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHJAZGS5YD2PRN3LJFQ6PTSAFHOVANCNFSM4P3BX5OA .

0reactions
matt-riemercommented, Aug 31, 2020

Hmm, I just don’t receive the original error, DEPRECATION WARNING: Initialization autoloaded the constant ActsAsArchived.

Any chance you could share a repo? I’d take another look at this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Initialization autoloaded the constants..." but I can't figure out ...
Rails 6 Zeitwerk "DEPRECATION WARNING: Initialization autoloaded the constants..." but I can't figure out where? ; and ApplicationController.
Read more >
Deprecation Warning with Rails 6.1 & Zeitwerk #30 - GitHub
We're seeing deprecation warnings while upgrading to Rails 6.1: DEPRECATION WARNING: Initialization autoloaded the constants ActionText:: ...
Read more >
The Complete Guide for Deprecation Warnings in Rails
When it comes to production, the easiest way to discover deprecation warnings is by using a monitoring tool (like Honeybadger or Airbrake).
Read more >
Upgrading Ruby on Rails
It is only soft-deprecated, which means that your code will not break at the moment and no deprecation warning will be displayed, but...
Read more >
Feature #32938: Rails 6: Zeitwerk support - Redmine
DEPRECATION WARNING: Initialization autoloaded the constants ... 0007-Move-only-modules-and-classes-that-match-Zeitwerk-ru.patch · Magnifier ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found