Skip to content

Rails6 without ActionMailer won't boot with zeitwerk eager-loadingΒ #5140

Closed
@sbull

Description

Environment

  • Ruby 2.6.3
  • Rails 6.0.0
  • Devise 4.7.1

Current behavior

In a Rails 6 app without ActionMailer included (rails new testapp --skip-action-mailer), the default zeitwerk loader errors when eager-loading due to mailers/devise/mailer.rb not defining Devise::Mailer. Output from rails zeitwerk:check:
expected file /usr/local/bundle/gems/devise-4.7.1/app/mailers/devise/mailer.rb to define constant Devise::Mailer,

Expected behavior

Zeitwerk eager-loading should work without ActionMailer. Suggested options:

  • (easy) Define a dummy Devise::Mailer when ActionMailer is not defined.
  • (hard?) Customize the zeitwerk loader for when ActionMailer is not used.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions