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

Gem clashing #991

Closed
AbdullahAli opened this issue Oct 23, 2017 · 1 comment
Closed

Gem clashing #991

AbdullahAli opened this issue Oct 23, 2017 · 1 comment

Comments

@AbdullahAli
Copy link

AbdullahAli commented Oct 23, 2017

Hey, when I use the following gems and version, I get the following error:

gem 'devise_token_auth'
gem "active_model_serializers", "~> 0.8.1"

if I update active_model_serializers to version 10, then devise_token_auth works. Looks like devise_token_auth is clashing somehow, any idea how to fix without changing the active_model_serializers, since it involves big changes to my app

NameError at /auth/sign_in
==========================

> uninitialized constant DeviseTokenAuth::ApplicationController::ActiveModelSerializers

activesupport (4.2.7.1) lib/active_support/dependencies.rb, line 533
--------------------------------------------------------------------

``` ruby
  528             raise unless e.missing_name? qualified_name_for(parent, const_name)
  529           end
  530         end
  531   
  532         name_error = NameError.new("uninitialized constant #{qualified_name}", const_name)
> 533         name_error.set_backtrace(caller.reject {|l| l.starts_with? __FILE__ })
  534         raise name_error
  535       end
  536   
  537       # Remove the constants that have been autoloaded, and those that have been
  538       # marked for unloading. Before each constant is removed a callback is sent

App backtrace

Full backtrace

  • activesupport (4.2.7.1) lib/active_support/dependencies.rb:533:in `load_missing_constant'
  • activesupport (4.2.7.1) lib/active_support/dependencies.rb:184:in `const_missing'
  • devise_token_auth (0.1.42) app/controllers/devise_token_auth/application_controller.rb:41:in `is_json_api'
  • devise_token_auth (0.1.42) app/controllers/devise_token_auth/application_controller.rb:7:in `resource_data'
  • devise_token_auth (0.1.42) app/controllers/devise_token_auth/sessions_controller.rb:116:in `render_create_success'
  • devise_token_auth (0.1.42) app/controllers/devise_token_auth/sessions_controller.rb:52:in `create'
  • actionpack (4.2.7.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  • actionpack (4.2.7.1) lib/abstract_controller/base.rb:198:in `process_action'
  • actionpack (4.2.7.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
  • actionpack (4.2.7.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:117:in `call'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:505:in `call'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:92:in `run_callbacks'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
  • actionpack (4.2.7.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
  • actionpack (4.2.7.1) lib/action_controller/metal/rescue.rb:29:in `process_action'
  • actionpack (4.2.7.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  • activesupport (4.2.7.1) lib/active_support/notifications.rb:164:in `block in instrument'
  • activesupport (4.2.7.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  • activesupport (4.2.7.1) lib/active_support/notifications.rb:164:in `instrument'
  • actionpack (4.2.7.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  • actionpack (4.2.7.1) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  • activerecord (4.2.7.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  • actionpack (4.2.7.1) lib/abstract_controller/base.rb:137:in `process'
  • actionview (4.2.7.1) lib/action_view/rendering.rb:30:in `process'
  • actionpack (4.2.7.1) lib/action_controller/metal.rb:196:in `dispatch'
  • actionpack (4.2.7.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  • actionpack (4.2.7.1) lib/action_controller/metal.rb:237:in `block in action'
  • actionpack (4.2.7.1) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
  • actionpack (4.2.7.1) lib/action_dispatch/routing/route_set.rb:43:in `serve'
  • actionpack (4.2.7.1) lib/action_dispatch/routing/mapper.rb:49:in `serve'
  • actionpack (4.2.7.1) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  • actionpack (4.2.7.1) lib/action_dispatch/journey/router.rb:30:in `serve'
  • actionpack (4.2.7.1) lib/action_dispatch/routing/route_set.rb:817:in `call'
  • bullet (5.5.1) lib/bullet/rack.rb:12:in `call'
  • warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
  • warden (1.2.7) lib/warden/manager.rb:35:in `call'
  • rack (1.6.5) lib/rack/etag.rb:24:in `call'
  • rack (1.6.5) lib/rack/conditionalget.rb:38:in `call'
  • rack (1.6.5) lib/rack/head.rb:13:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/flash.rb:260:in `call'
  • rack (1.6.5) lib/rack/session/abstract/id.rb:225:in `context'
  • rack (1.6.5) lib/rack/session/abstract/id.rb:220:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  • activerecord (4.2.7.1) lib/active_record/query_cache.rb:36:in `call'
  • activerecord (4.2.7.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  • activerecord (4.2.7.1) lib/active_record/migration.rb:377:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:88:in `run_callbacks'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
  • activesupport (4.2.7.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  • rollbar (2.14.0) lib/rollbar/middleware/rails/rollbar.rb:24:in `block in call'
  • rollbar (2.14.0) lib/rollbar.rb:145:in `scoped'
  • rollbar (2.14.0) lib/rollbar/middleware/rails/rollbar.rb:22:in `call'
  • better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
  • better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
  • better_errors (1.1.0) lib/better_errors/middleware.rb:56:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  • rollbar (2.14.0) lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  • railties (4.2.7.1) lib/rails/rack/logger.rb:38:in `call_app'
  • railties (4.2.7.1) lib/rails/rack/logger.rb:20:in `block in call'
  • activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  • activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  • activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  • railties (4.2.7.1) lib/rails/rack/logger.rb:20:in `call'
  • request_store (1.2.0) lib/request_store/middleware.rb:8:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  • rack (1.6.5) lib/rack/methodoverride.rb:22:in `call'
  • rack (1.6.5) lib/rack/runtime.rb:18:in `call'
  • activesupport (4.2.7.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  • rack (1.6.5) lib/rack/lock.rb:17:in `call'
  • actionpack (4.2.7.1) lib/action_dispatch/middleware/static.rb:120:in `call'
  • rack (1.6.5) lib/rack/sendfile.rb:113:in `call'
  • rack-cors (1.0.1) lib/rack/cors.rb:93:in `call'
  • railties (4.2.7.1) lib/rails/engine.rb:518:in `call'
  • railties (4.2.7.1) lib/rails/application.rb:165:in `call'
  • rack (1.6.5) lib/rack/content_length.rb:15:in `call'
  • puma (3.2.0) lib/puma/configuration.rb:227:in `call'
  • puma (3.2.0) lib/puma/server.rb:561:in `handle_request'
  • puma (3.2.0) lib/puma/server.rb:406:in `process_client'
  • puma (3.2.0) lib/puma/server.rb:271:in `block in run'
  • puma (3.2.0) lib/puma/thread_pool.rb:111:in `block in spawn_thread'
@MaicolBen
Copy link
Collaborator

MaicolBen commented Oct 28, 2017

0.8.1 has 4 years, if there was the other way around (like we have to update to the last active_model_serializers version), we would do it.

So you have 2 options:

  • Update the active_model_serializers gem, or
  • Override is_json_api and replace the code with the previous version of ActiveModelSerializers. You can do a concern in your code and add it to each devise token auth controller.

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