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

ConfirmationsController#show - undefined method `rails51?' for Devise:Module #1429

Closed
benkovy opened this issue Sep 3, 2020 · 1 comment
Closed

Comments

@benkovy
Copy link

benkovy commented Sep 3, 2020

  • Version: 1.1.4 - not using a client atm (just mailcatcher and postman)
  • Environmental Info:
    • Routes: routes are mounted in an api namspace and scope v1.
    • Gems: Nothing out of the ordinary. See gemfile disclosure at the bottom of the issue.
    • Custom Overrides: No custom overrides
    • Custom Frontend: n/a
Stack trace

NoMethodError (undefined method `rails51?' for Devise:Module):

devise_token_auth (1.1.4) app/models/devise_token_auth/concerns/confirmable_support.rb:21:in `email_value_in_database'
devise_token_auth (1.1.4) app/models/devise_token_auth/concerns/confirmable_support.rb:9:in `postpone_email_change?'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:428:in `block in make_lambda'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:180:in `block (2 levels) in halting_and_conditional'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:180:in `all?'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:180:in `block in halting_and_conditional'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:513:in `block in invoke_before'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:513:in `each'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:513:in `invoke_before'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:134:in `run_callbacks'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:825:in `_run_update_callbacks'
activerecord (6.0.3.2) lib/active_record/callbacks.rb:335:in `_update_record'
activerecord (6.0.3.2) lib/active_record/timestamp.rb:123:in `_update_record'
activerecord (6.0.3.2) lib/active_record/persistence.rb:905:in `create_or_update'
activerecord (6.0.3.2) lib/active_record/callbacks.rb:327:in `block in create_or_update'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:135:in `run_callbacks'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
activerecord (6.0.3.2) lib/active_record/callbacks.rb:327:in `create_or_update'
activerecord (6.0.3.2) lib/active_record/timestamp.rb:128:in `create_or_update'
activerecord (6.0.3.2) lib/active_record/persistence.rb:470:in `save'
activerecord (6.0.3.2) lib/active_record/validations.rb:47:in `save'
activerecord (6.0.3.2) lib/active_record/transactions.rb:314:in `block in save'
activerecord (6.0.3.2) lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
activerecord (6.0.3.2) lib/active_record/transactions.rb:212:in `transaction'
activerecord (6.0.3.2) lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
activerecord (6.0.3.2) lib/active_record/transactions.rb:314:in `save'
activerecord (6.0.3.2) lib/active_record/suppressor.rb:44:in `save'
devise (4.7.2) lib/devise/models/confirmable.rb:97:in `block in confirm'
devise (4.7.2) lib/devise/models/confirmable.rb:239:in `pending_any_confirmation'
devise (4.7.2) lib/devise/models/confirmable.rb:80:in `confirm'
devise (4.7.2) lib/devise/models/confirmable.rb:373:in `confirm_by_token'
devise_token_auth (1.1.4) app/controllers/devise_token_auth/confirmations_controller.rb:7:in `show'
actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:195:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:135:in `run_callbacks'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.3.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `instrument'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (6.0.3.2) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:136:in `process'
actionview (6.0.3.2) lib/action_view/rendering.rb:39:in `process'
actionpack (6.0.3.2) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.0.3.2) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
actionpack (6.0.3.2) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:834:in `call'
rack-cors (1.1.1) lib/rack/cors.rb:100:in `call'
warden (1.2.9) lib/warden/manager.rb:36:in `block in call'
warden (1.2.9) lib/warden/manager.rb:34:in `catch'
warden (1.2.9) lib/warden/manager.rb:34:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.0.3.2) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/cookies.rb:648:in `call'
activerecord (6.0.3.2) lib/active_record/migration.rb:567:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
web-console (4.0.4) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.0.4) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.0.4) lib/web_console/middleware.rb:17:in `catch'
web-console (4.0.4) lib/web_console/middleware.rb:17:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.3.2) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.0.3.2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.3.2) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (6.0.3.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/host_authorization.rb:82:in `call'
railties (6.0.3.2) lib/rails/engine.rb:527:in `call'
puma (4.3.5) lib/puma/configuration.rb:228:in `call'
puma (4.3.5) lib/puma/server.rb:713:in `handle_request'
puma (4.3.5) lib/puma/server.rb:472:in `process_client'
puma (4.3.5) lib/puma/server.rb:328:in `block in run'
puma (4.3.5) lib/puma/thread_pool.rb:134:in `block in spawn_thread'

Gemfile

ruby '2.6.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.2'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Active Model has_secure_password
gem 'bcrypt', '~> 3.1.7'

gem 'graphql', '1.9.17'

gem 'devise', '4.7.2'

gem 'devise_token_auth', '1.1.4'

gem 'omniauth', '~> 1.9', '>= 1.9.1'

gem 'rack-cors', '~> 1.0', '>= 1.0.5'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '~> 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'graphiql-rails', '1.7.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Steps taken to produce

Using postman I sent a POST request to:

localhost:3000/api/v1/auth?
  [email protected]&
  password=blahblah&
  password_confirmation=blahblah&
  confirm_success_url=https://www.google.ca

Within mailcatcher I received the confirmation email and followed the Confirm my account link. The request goes to ConfirmationsController#show where a NoMethodError is raised. Specifically, undefined method rails51?' for Devise:Module`

Screen Shot 2020-09-03 at 3 07 27 PM

Seems the devise gem needs to be bumped?

@MaicolBen
Copy link
Collaborator

Use master, that fix has been fixed it in #1412

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

2 participants