How to fix undefined method address_list in Rails 6.x and 7.x.
Updating the mail gem breaks Mail#address_list
1 min read
The other day I came across an issue where I saw this error:
# mail.address_list NoMethodError: undefined method `address_list'
The error was coming from this line: https://github.com/rails/rails/blob/6-1-stable/actionmailbox/lib/action_mailbox/mail_ext/addresses.rb#L5-L7.
As I often like to do, I periodically review gem dependencies in an app and upgrade them to keep things, well... up-to-date.
In this situation, I updated the
As it turns out, when the
address_list was no longer part of the newly released
It appeared that others were also having the same problem, and a solution was backported to Rails 6-1 and 7-0 stable:
As of this writing, these versions have not yet been released. So, a temporary fix may be to downgrade
Alternatively, one could use 6-1 or 7-0 stable and reference those versions in the
Gemfile. It is expected that this fix should be available in Rails 6.1.8 and 7.0.5 when these will be released.