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

Bug Report: Rails 8 Compatibility Issue with Suspenders - action_mailer undefined method error #1253

Open
eddardward opened this issue Mar 27, 2025 · 0 comments

Comments

@eddardward
Copy link

When attempting to create a new Rails 8.0.2 application using Suspenders, the installation fails with an error indicating that action_mailer is an undefined method for the Rails Application Configuration object.

Steps to Reproduce:

  1. Install Rails 8.0.2: gem install rails -v 8.0.2
  2. Run the following command to create a new application:
rails _8.0.2_ new my_app \
  --skip-rubocop \
  --skip-test \
  -d=postgresql \
  -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb

Error Message:

generate suspenders:factories
rails generate suspenders:factories
/Users/joekenn/.gem/ruby/ruby/3.2.0/gems/railties-8.0.2/lib/rails/railtie/configuration.rb:109:in method_missing': undefined method action_mailer' for #Rails::Application::Configuration:0x000000000020a8 (NoMethodError)

Environment:

Ruby version: 3.2.0
Rails version: 8.0.2
Suspenders: Latest version from main branch
Operating System: macOS

Analysis:

The error occurs during the suspenders:factories generator. This seems to be due to changes in Rails 8's configuration structure where action_mailer might need to be explicitly required or is accessed differently than in previous Rails versions.

The issue is likely in how Suspenders attempts to configure Action Mailer in the factories generator. Rails 8 has made architectural changes to how certain components are accessed or configured.

Possible Solutions:

Update the Suspenders generators to be compatible with Rails 8's configuration API
Add conditional logic to handle different Rails versions differently
Explicitly require action_mailer before attempting to configure it

Additional Information:

I also tried with Rails 8.0.0 and encountered the same error, indicating this is a general Rails 8 compatibility issue rather than a specific point release problem.

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

1 participant