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

Rails 6 Zeitwerk Warning #27

Open
aidandamerell opened this issue Oct 30, 2019 · 5 comments
Open

Rails 6 Zeitwerk Warning #27

aidandamerell opened this issue Oct 30, 2019 · 5 comments

Comments

@aidandamerell
Copy link

DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper and ActionText::TagHelper.

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 ActionText::ContentHelper, for example,
the expected changes won't be reflected in that stale Module object.

These autoloaded constants have been unloaded.

Please, check the "Autoloading and Reloading Constants" guide for solutions.
(called from <top (required)> at XXX

@pelargir
Copy link
Owner

pelargir commented Nov 7, 2019

Thanks for alerting me to this. I've been working on a new version of this gem that's compatible with Rails 6 and will incorporate this feedback into those changes.

@moveson
Copy link

moveson commented Feb 7, 2021

I'm seeing this warning as well. Any progress on Rails 6 compatibility?

@pelargir
Copy link
Owner

pelargir commented Feb 7, 2021

@aidandamerell @moveson I'm curious where you both are seeing this. In the Rails log?

I'm running the gem on a freshly created Rails 6.1 project (with Devise) and I'm not seeing these warnings in the log, at least not in development mode. If you can provide more detail I'd like to help.

@krsyoung
Copy link

krsyoung commented Mar 8, 2021

Hey, I seem to be in the same boat although my error only includes ActionText::ContentHelper.

This is a rails 6.0 app that is being bumped to 6.1.

Will keep poking around to see if I can figure out what is going on. Curious if @aidandamerell or @moveson made progress?

Cleaned backtrace:
        auto-session-timeout (0.9.7) lib/auto_session_timeout.rb:56:in `<main>'
        auto-session-timeout (0.9.7) lib/auto-session-timeout.rb:1:in `<main>'
        /app/config/application.rb:26:in `<main>'
        /app/rakefile:4:in `<main>'
        rake (13.0.3) lib/rake/rake_module.rb:29:in `load_rakefile'
        rake (13.0.3) lib/rake/application.rb:703:in `raw_load_rakefile'
        rake (13.0.3) lib/rake/application.rb:104:in `block in load_rakefile'
        rake (13.0.3) lib/rake/application.rb:186:in `standard_exception_handling'
        rake (13.0.3) lib/rake/application.rb:103:in `load_rakefile'
        rake (13.0.3) lib/rake/rake_module.rb:59:in `with_application'
        /app/bin/rails:10:in `<top (required)>'
        /app/bin/spring:15:in `require'
        /app/bin/spring:15:in `<top (required)>'
Most probably the cause is: auto-session-timeout (0.9.7) lib/auto_session_timeout.rb:56:in `<main>'

In a completely unscientific experiment the following seems to remove the error:

# lib/auto_session_timeout.rb:56
ActiveSupport.on_load(:action_controller) do
  ActionController::Base.send :include, AutoSessionTimeout
end

@pelargir
Copy link
Owner

Are you still getting this warning? It shouldn't be happening any longer.

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

No branches or pull requests

4 participants