Devise: recoverable: wrong number of arguments (3 for 1..2)

Created on 6 Apr 2014  路  5Comments  路  Source: heartcombo/devise

When trying to reset password, posting the form results in:

wrong number of arguments (3 for 1..2)

The line in question is inside: devise (3.2.4) lib/devise/models/recoverable.rb:

send_devise_notification(:reset_password_instructions, raw, {})

The user model is setup to allow signin/etc using their username or email, following the guide in the wiki and setting all config keys to use the login attribute.

Using devise 3.2.4 and rails 4.0.4.

Most helpful comment

You're right it seems to be the devise-async extension. Thanks!

All 5 comments

Can you please provide a sample application that reproduces the error?

The most likely is that the wiki is outdated and one of the methods you changed do not behave as you expected. Can you please post a stacktrace meanwhile?

ArgumentError - wrong number of arguments (3 for 1..2):
  devise (3.2.4) lib/devise/models/recoverable.rb:54:in `send_reset_password_instructions'
  devise (3.2.4) lib/devise/models/recoverable.rb:100:in `send_reset_password_instructions'
  devise (3.2.4) app/controllers/devise/passwords_controller.rb:13:in `create'
  actionpack (4.0.4) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.0.4) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.0.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.0.4) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (4.0.4) lib/active_support/callbacks.rb:463:in `_run__3349069612925318224__process_action__callbacks'
  activesupport (4.0.4) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.4) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (4.0.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.0.4) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.0.4) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.0.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.0.4) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.0.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.0.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.0.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.0.4) lib/abstract_controller/base.rb:136:in `process'
  actionpack (4.0.4) lib/abstract_controller/rendering.rb:44:in `process'
  actionpack (4.0.4) lib/action_controller/metal.rb:195:in `dispatch'
  actionpack (4.0.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.0.4) lib/action_controller/metal.rb:231:in `block in action'
  actionpack (4.0.4) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
  actionpack (4.0.4) lib/action_dispatch/routing/route_set.rb:48:in `call'
  actionpack (4.0.4) lib/action_dispatch/routing/mapper.rb:44:in `call'
  actionpack (4.0.4) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.0.4) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.0.4) lib/action_dispatch/routing/route_set.rb:674:in `call'
  dragonfly (1.0.3) lib/dragonfly/middleware.rb:14:in `call'
  meta_request (0.2.7) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
  rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
  meta_request (0.2.7) lib/meta_request/middlewares/headers.rb:16:in `call'
  meta_request (0.2.7) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
  bullet (4.6.0) lib/bullet/rack.rb:10:in `call'
  newrelic_rpm (3.6.5.130) lib/new_relic/rack/error_collector.rb:12:in `call'
  newrelic_rpm (3.6.5.130) lib/new_relic/rack/agent_hooks.rb:22:in `call'
  newrelic_rpm (3.6.5.130) lib/new_relic/rack/browser_monitoring.rb:16:in `call'
  newrelic_rpm (3.6.5.130) lib/new_relic/rack/developer_mode.rb:28:in `call'
  rack-cors (0.2.9) lib/rack/cors.rb:54:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.2) lib/rack/etag.rb:23:in `call'
  rack (1.5.2) lib/rack/conditionalget.rb:35:in `call'
  rack (1.5.2) lib/rack/head.rb:11:in `call'
  remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/flash.rb:241:in `call'
  rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/cookies.rb:486:in `call'
  activerecord (4.0.4) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
  activerecord (4.0.4) lib/active_record/migration.rb:373:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.0.4) lib/active_support/callbacks.rb:373:in `_run__3432565200675053768__call__callbacks'
  activesupport (4.0.4) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/reloader.rb:64:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  airbrake (3.1.12) lib/airbrake/rails/middleware.rb:13:in `call'
   () Users/chrisedwards/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/better_errors-36fc5de969bd/lib/better_errors/middleware.rb:84:in `protected_app_call'
   () Users/chrisedwards/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/better_errors-36fc5de969bd/lib/better_errors/middleware.rb:79:in `better_errors_call'
   () Users/chrisedwards/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/better_errors-36fc5de969bd/lib/better_errors/middleware.rb:56:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.4) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.0.4) lib/rails/rack/logger.rb:20:in `call'
  quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
  actionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  dragonfly (1.0.3) lib/dragonfly/cookie_monster.rb:9:in `call'
  actionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  airbrake (3.1.12) lib/airbrake/user_informer.rb:16:in `_call'
  airbrake (3.1.12) lib/airbrake/user_informer.rb:12:in `call'
  railties (4.0.4) lib/rails/engine.rb:511:in `call'
  railties (4.0.4) lib/rails/application.rb:97:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  thin (1.6.1) lib/thin/connection.rb:82:in `block in pre_process'
  thin (1.6.1) lib/thin/connection.rb:80:in `pre_process'
  thin (1.6.1) lib/thin/connection.rb:55:in `process'
  thin (1.6.1) lib/thin/connection.rb:41:in `receive_data'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
  thin (1.6.1) lib/thin/backends/base.rb:73:in `start'
  thin (1.6.1) lib/thin/server.rb:162:in `start'
  rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
  rack (1.5.2) lib/rack/server.rb:264:in `start'
  railties (4.0.4) lib/rails/commands/server.rb:84:in `start'
  railties (4.0.4) lib/rails/commands.rb:76:in `block in <top (required)>'
  railties (4.0.4) lib/rails/commands.rb:71:in `<top (required)>'
  bin/rails:4:in `<main>'

That line invokes this method:

https://github.com/plataformatec/devise/blob/v3.2.4/lib/devise/models/recoverable.rb#L54

Which is defined here:

https://github.com/plataformatec/devise/blob/v3.2.4/lib/devise/models/authenticatable.rb#L172-L174

My guess is that you are using a devise extension or you have modified your own app to an incompatible implementation of that method.

You're right it seems to be the devise-async extension. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gorchel picture Gorchel  路  3Comments

ragesoss picture ragesoss  路  3Comments

Pedroknoll picture Pedroknoll  路  3Comments

mikeki picture mikeki  路  4Comments

spaquet picture spaquet  路  3Comments