Deprecation Warning in Rails 6 initialization
ryanb opened this issue ยท 2 comments
ryanb commented
When starting a Rails 6 app with the localeapp
gem we get this warning:
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 /Users/rbates/code/envisage/config/environment.rb:5)
This is because localeapp
calls ActionController::Base
in an initializer. See rails/rails#36546 for details.
To fix this you can wrap calls to ActionController::Base
in ActiveSupport.on_load(:action_controller) do
block.
thibaultdalban commented
Hi @ryanb ๐,
Thank you for your feedback and for providing the solution as well ๐
We added this issue to the roadmap, so it should be fixed very soon!
thibaultdalban commented
Hello @ryanb,
A new version has been released ๐
https://rubygems.org/gems/localeapp/versions/3.1.3
Thank you for reporting this issue ๐
Happy Translating ๐