3

I'm developing a Rails 4 app with Devise. I wanted to start using confirmable, but whenever it's sending out a confirmation email, it throws said ArgumentError.

Stacktrace:

ArgumentError (method 'sort!': given 0, expected 1):
kernel/common/enumerable.rb:260:in `sort_by'
mail (2.6.1) lib/mail/parts_list.rb:36:in `sort!'
mail (2.6.1) lib/mail/message.rb:1789:in `ready_to_send!'
mail (2.6.1) lib/mail/message.rb:1806:in `encoded'
actionmailer (4.1.6) lib/action_mailer/base.rb:546:in `set_payload_for_mail'
actionmailer (4.1.6) lib/action_mailer/base.rb:526:in `deliver_mail'
activesupport (4.1.6) lib/active_support/notifications.rb:159:in `instrument'
activesupport (4.1.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.6) lib/active_support/notifications.rb:159:in `instrument'
actionmailer (4.1.6) lib/action_mailer/base.rb:525:in `deliver_mail'
mail (2.6.1) lib/mail/message.rb:232:in `deliver'
devise (3.3.0) lib/devise/models/authenticatable.rb:173:in `send_devise_notification'
devise (3.3.0) lib/devise/models/confirmable.rb:102:in `send_confirmation_instructions'
devise (3.3.0) lib/devise/models/confirmable.rb:158:in `send_on_create_confirmation_instructions'
activesupport (4.1.6) lib/active_support/callbacks.rb:424:in `make_lambda'
<...>

I'm using rbx 2.2.10

1 Answers1

3

I had a similar error using rbx-2.2.10 and Rails 4.16. Seems to be a bug in the 'mail' gem which for me was a dependency of devise-invitable. (

bundle dependency mail --reverse-dependencies

and the above command again for actionmailer)

I got around this by specifying an older version of the mail gem in my Gemfile

gem 'mail', '~> 2.5.4'

And then running

bundle update mail

I've also raised an issue on the github page for mail : https://github.com/mikel/mail/issues/803

-----Update----

if you are happy to work with their master branch -- on the edge -- this is fixed

gem 'mail', github: 'mikel/mail', branch: 'master'

ryan2johnson9
  • 724
  • 6
  • 21
  • same here. Downgrading mail helped – Piotr Dec 15 '14 at 18:49
  • Apparently a pull request has been merged and fixed this issue - see https://github.com/mikel/mail/pull/782 But I have not tried updating mail yet. – ryan2johnson9 Mar 24 '15 at 01:15
  • working now off master branch thanks to merged pull request [#782] (github.com/mikel/mail/pull/782) in my Gemfile `gem 'mail', github: 'mikel/mail', branch: 'master'` – ryan2johnson9 Jun 17 '15 at 02:18