Project

General

Profile

Actions

Defect #35004

closed

DEPRECATION WARNING during startup

Added by Go MAEDA over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Rails support
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

$ bin/rails s
=> Booting Puma
=> Rails 6.1.3.1 application starting in development
=> Run `bin/rails server --help` for more startup options
DEPRECATION WARNING: Initialization autoloaded the constants ActiveRecord::Acts, ActiveRecord::Acts::Tree, Redmine::I18n, Redmine::Helpers, Redmine::Helpers::URL, Redmine::SafeAttributes, Redmine::SubclassFactory, CustomField, Redmine::Utils, Redmine::Configuration, Redmine::Scm::Adapters::CommandFailed, IssueRelation, Redmine::WikiFormatting::Macros, Redmine::Pagination, Redmine::SudoMode, ApplicationHelper, Redmine::WikiFormatting::Textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper, Redmine::WikiFormatting::HtmlParser, Redmine::WikiFormatting::Textile::HtmlParser, Redmine::WikiFormatting::Markdown, Redmine::WikiFormatting::Markdown::HTML, Redmine::WikiFormatting::Markdown::Formatter, Redmine::WikiFormatting::Markdown::Helper, Redmine::WikiFormatting::Markdown::HtmlParser, and Redmine::Views::ApiTemplateHandler.

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

`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.

In order to autoload safely at boot time, please wrap your code in a reloader
callback this way:

    Rails.application.reloader.to_prepare do
      # Autoload classes and modules needed at boot time here.
    end

That block runs when the application boots, and every time there is a reload.
For historical reasons, it may run twice, so it has to be idempotent.

Check the "Autoloading and Reloading Constants" guide to learn more about how
Rails autoloads and reloads.
 (called from <top (required)> at /path/to/redmine/config/environment.rb:16)

Related issues

Related to Redmine - Feature #29914: Migrate to Rails 6.1 with Zeitwerk autoloadingClosedGo MAEDA

Actions
Is duplicate of Redmine - Feature #32938: Rails 6: Zeitwerk supportClosedMarius BĂLTEANU

Actions
Actions #1

Updated by Go MAEDA over 3 years ago

  • Related to Feature #29914: Migrate to Rails 6.1 with Zeitwerk autoloading added
Actions #2

Updated by Pavel Rosický over 3 years ago

refs #32938

Actions #3

Updated by Marius BĂLTEANU over 3 years ago

  • Has duplicate Defect #35028: Deprecation message when executing 'bundle install' added
Actions #4

Updated by Marius BĂLTEANU over 3 years ago

  • Has duplicate deleted (Defect #35028: Deprecation message when executing 'bundle install')
Actions #5

Updated by Go MAEDA over 3 years ago

  • Status changed from New to Closed
  • Target version deleted (5.0.0)
  • Resolution set to Duplicate

Closing as a duplicate of #32938.

Actions #6

Updated by Go MAEDA over 3 years ago

Actions

Also available in: Atom PDF