There is an application running on Rails 5 beta 4 in API mode and Angular2. For authorization used Devise + Devise Token Auth.

On the local server in development and production everything works fine.

Problems begin with deployment to Heroku.

On a GET request to / receive the following:

 2016-04-29T12:22:42.570708+00:00 heroku[router]: at=info method=GET path="/" host=yaktalk.herokuapp.com request_id=79c11e3e-66c3-4380-a641-caae9eaeee8d fwd="109.229.68.244" dyno=web.1 connect=1ms service=3ms status=200 bytes=2514 2016-04-29T12:22:42.764938+00:00 heroku[router]: at=info method=GET path="/node_modules/tether/dist/js/tether.min.js" host=yaktalk.herokuapp.com request_id=35d65a33-7999-457a-b331-9d4e3299a3ed fwd="109.229.68.244" dyno=web.1 connect=1ms service=3ms status=200 bytes=23453 2016-04-29T12:22:42.762029+00:00 heroku[router]: at=info method=GET path="/node_modules/tether/dist/css/tether.min.css" host=yaktalk.herokuapp.com request_id=931d24c8-c49c-4e95-a988-ce303175e569 fwd="109.229.68.244" dyno=web.1 connect=1ms service=1ms status=200 bytes=366 2016-04-29T12:22:42.908337+00:00 heroku[router]: at=info method=GET path="/node_modules/bootstrap/dist/css/bootstrap.min.css" host=yaktalk.herokuapp.com request_id=c4bb11bc-1db4-4310-a087-001fae79b5c5 fwd="109.229.68.244" dyno=web.1 connect=1ms service=7ms status=200 bytes=95694 2016-04-29T12:22:42.929356+00:00 heroku[router]: at=info method=GET path="/style.css" host=yaktalk.herokuapp.com request_id=37ebb298-fdcd-47e7-bf07-dab15e3c1aac fwd="109.229.68.244" dyno=web.1 connect=1ms service=9ms status=200 bytes=2487 2016-04-29T12:22:42.923269+00:00 heroku[router]: at=info method=GET path="/node_modules/jquery/dist/jquery.min.js" host=yaktalk.herokuapp.com request_id=14779714-9daf-48f1-94c3-71b4565259de fwd="109.229.68.244" dyno=web.1 connect=0ms service=7ms status=200 bytes=85804 2016-04-29T12:22:42.930011+00:00 heroku[router]: at=info method=GET path="/node_modules/bootstrap/dist/js/bootstrap.min.js" host=yaktalk.herokuapp.com request_id=db7ddfec-a837-4381-a942-91c2a2a93de9 fwd="109.229.68.244" dyno=web.1 connect=1ms service=7ms status=200 bytes=44971 2016-04-29T12:22:42.952537+00:00 heroku[router]: at=info method=GET path="/node_modules/angular2/bundles/angular2-polyfills.js" host=yaktalk.herokuapp.com request_id=14d7fcbe-8ee4-4913-8e95-af8df8f8dd61 fwd="109.229.68.244" dyno=web.1 connect=1ms service=12ms status=200 bytes=103859 2016-04-29T12:22:43.049183+00:00 heroku[router]: at=info method=GET path="/node_modules/systemjs/dist/system.src.js" host=yaktalk.herokuapp.com request_id=dc6d9fa6-af6c-472a-90b3-f321dcbb9397 fwd="109.229.68.244" dyno=web.1 connect=1ms service=9ms status=200 bytes=162534 2016-04-29T12:22:43.093086+00:00 heroku[router]: at=info method=GET path="/node_modules/rxjs/bundles/Rx.js" host=yaktalk.herokuapp.com request_id=050e5a30-601d-43cc-bd10-855897d60c2b fwd="109.229.68.244" dyno=web.1 connect=1ms service=22ms status=200 bytes=407932 2016-04-29T12:22:43.462405+00:00 heroku[router]: at=info method=GET path="/node_modules/angular2/bundles/router.dev.js" host=yaktalk.herokuapp.com request_id=96e99e58-a195-40c3-88ec-fb1cc704bbc5 fwd="109.229.68.244" dyno=web.1 connect=1ms service=10ms status=200 bytes=142936 2016-04-29T12:22:43.381616+00:00 heroku[router]: at=info method=GET path="/node_modules/angular2/bundles/angular2.dev.js" host=yaktalk.herokuapp.com request_id=2c1c27d6-8f3b-4816-b968-939e152b2a7f fwd="109.229.68.244" dyno=web.1 connect=1ms service=40ms status=200 bytes=1095459 2016-04-29T12:22:43.473473+00:00 heroku[router]: at=info method=GET path="/node_modules/angular2/bundles/http.dev.js" host=yaktalk.herokuapp.com request_id=787a8e3e-f0ba-424f-8a84-874b0e9e58db fwd="109.229.68.244" dyno=web.1 connect=1ms service=6ms status=200 bytes=48996 2016-04-29T12:22:44.805997+00:00 heroku[router]: at=info method=GET path="/app/main.js" host=yaktalk.herokuapp.com request_id=3cc7bba2-c4fd-4714-80dd-353a897248dc fwd="109.229.68.244" dyno=web.1 connect=1ms service=8ms status=200 bytes=946 2016-04-29T12:22:44.947382+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=yaktalk.herokuapp.com request_id=1bf62c43-a871-4500-a931-669a392927b1 fwd="109.229.68.244" dyno=web.1 connect=1ms service=2ms status=200 bytes=143 2016-04-29T12:22:44.962279+00:00 heroku[router]: at=info method=GET path="/app/app.component.js" host=yaktalk.herokuapp.com request_id=d145388a-704d-4031-9a1b-3a6ed727972f fwd="109.229.68.244" dyno=web.1 connect=1ms service=2ms status=200 bytes=3542 2016-04-29T12:22:45.410108+00:00 heroku[router]: at=info method=GET path="/app/messages/messages.service.js" host=yaktalk.herokuapp.com request_id=a3c9bbbc-eb83-4e57-8001-f6d9ca41971d fwd="109.229.68.244" dyno=web.1 connect=0ms service=2ms status=200 bytes=3878 2016-04-29T12:22:45.414038+00:00 heroku[router]: at=info method=GET path="/app/login/login.service.js" host=yaktalk.herokuapp.com request_id=3aacbdc9-1570-4552-bfc8-e6b6d354b029 fwd="109.229.68.244" dyno=web.1 connect=1ms service=2ms status=200 bytes=4180 2016-04-29T12:22:45.391832+00:00 heroku[router]: at=info method=GET path="/app/messages/messages.component.js" host=yaktalk.herokuapp.com request_id=4bca583c-f7a6-47b4-b9ed-c1c406de2909 fwd="109.229.68.244" dyno=web.1 connect=1ms service=3ms status=200 bytes=4188 2016-04-29T12:22:45.411166+00:00 heroku[router]: at=info method=GET path="/app/login/login.component.js" host=yaktalk.herokuapp.com request_id=95c2937c-179e-4b14-b31d-2e9bf46dc0fc fwd="109.229.68.244" dyno=web.1 connect=1ms service=3ms status=200 bytes=4099 2016-04-29T12:22:45.561673+00:00 heroku[router]: at=info method=GET path="/app/user.js" host=yaktalk.herokuapp.com request_id=3a8b9644-b803-4f95-bfba-60873c91d398 fwd="109.229.68.244" dyno=web.1 connect=1ms service=2ms status=200 bytes=879 2016-04-29T12:22:45.939576+00:00 heroku[router]: at=info method=GET path="/app/app.component.html" host=yaktalk.herokuapp.com request_id=8007e574-818c-4ae3-ac7c-d8a46b75b04a fwd="109.229.68.244" dyno=web.1 connect=1ms service=1ms status=200 bytes=320 2016-04-29T12:22:46.146029+00:00 heroku[router]: at=info method=GET path="/app/messages/messages.component.html" host=yaktalk.herokuapp.com request_id=4eea0955-b017-44c5-8494-c2bc60367f43 fwd="109.229.68.244" dyno=web.1 connect=1ms service=1ms status=200 bytes=314 2016-04-29T12:22:46.357210+00:00 heroku[router]: at=info method=GET path="/messages" host=yaktalk.herokuapp.com request_id=b27dcc4b-1e84-4d49-ba85-928c3f60a2f3 fwd="109.229.68.244" dyno=web.1 connect=0ms service=40ms status=500 bytes=1669 2016-04-29T12:22:46.358307+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] Started GET "/messages" for 109.229.68.244 at 2016-04-29 12:22:46 +0000 2016-04-29T12:22:46.361832+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] Processing by MessagesController#show as json 2016-04-29T12:22:46.368503+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] Completed 500 Internal Server Error in 7ms (ActiveRecord: 2.8ms) 2016-04-29T12:22:46.369575+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] 2016-04-29T12:22:46.369954+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] NoMethodError (undefined method `find_by_uid' for #<Class:0x007fd93e174750>): 2016-04-29T12:22:46.369988+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] 2016-04-29T12:22:46.370017+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.beta4/lib/active_record/dynamic_matchers.rb:21:in `method_missing' 2016-04-29T12:22:46.370054+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/bundler/gems/devise_token_auth-10863b31270b/app/controllers/devise_token_auth/concerns/set_user_by_token.rb:61:in `set_user_by_token' 2016-04-29T12:22:46.370081+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/bundler/gems/devise_token_auth-10863b31270b/lib/devise_token_auth/controllers/helpers.rb:123:in `current_user' 2016-04-29T12:22:46.370173+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/bundler/gems/devise_token_auth-10863b31270b/lib/devise_token_auth/controllers/helpers.rb:111:in `authenticate_user!' 2016-04-29T12:22:46.370201+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:382:in `block in make_lambda' 2016-04-29T12:22:46.370236+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:169:in `call' 2016-04-29T12:22:46.370261+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:169:in `block (2 levels) in halting' 2016-04-29T12:22:46.370296+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/abstract_controller/callbacks.rb:12:in `call' 2016-04-29T12:22:46.370322+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/abstract_controller/callbacks.rb:12:in `block (2 levels) in <module:Callbacks>' 2016-04-29T12:22:46.370350+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:170:in `call' 2016-04-29T12:22:46.370413+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:170:in `block in halting' 2016-04-29T12:22:46.370446+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:454:in `call' 2016-04-29T12:22:46.370472+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:454:in `block in call' 2016-04-29T12:22:46.370507+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:454:in `each' 2016-04-29T12:22:46.370534+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:454:in `call' 2016-04-29T12:22:46.370590+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:101:in `__run_callbacks__' 2016-04-29T12:22:46.370638+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks' 2016-04-29T12:22:46.370640+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:90:in `run_callbacks' 2016-04-29T12:22:46.370655+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/abstract_controller/callbacks.rb:19:in `process_action' 2016-04-29T12:22:46.370694+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_controller/metal/rescue.rb:31:in `process_action' 2016-04-29T12:22:46.370709+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' 2016-04-29T12:22:46.370821+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/notifications.rb:164:in `block in instrument' 2016-04-29T12:22:46.370836+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/notifications/instrumenter.rb:21:in `instrument' 2016-04-29T12:22:46.370879+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/notifications.rb:164:in `instrument' 2016-04-29T12:22:46.370884+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_controller/metal/instrumentation.rb:30:in `process_action' 2016-04-29T12:22:46.370928+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_controller/metal/params_wrapper.rb:248:in `process_action' 2016-04-29T12:22:46.370944+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.beta4/lib/active_record/railties/controller_runtime.rb:18:in `process_action' 2016-04-29T12:22:46.370978+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/abstract_controller/base.rb:126:in `process' 2016-04-29T12:22:46.370992+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_controller/metal.rb:190:in `dispatch' 2016-04-29T12:22:46.371024+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_controller/metal.rb:262:in `dispatch' 2016-04-29T12:22:46.371052+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/routing/route_set.rb:50:in `dispatch' 2016-04-29T12:22:46.371087+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/routing/route_set.rb:32:in `serve' 2016-04-29T12:22:46.371113+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/journey/router.rb:39:in `block in serve' 2016-04-29T12:22:46.371139+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/journey/router.rb:26:in `each' 2016-04-29T12:22:46.371207+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/journey/router.rb:26:in `serve' 2016-04-29T12:22:46.371234+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/routing/route_set.rb:725:in `call' 2016-04-29T12:22:46.371301+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:35:in `block in call' 2016-04-29T12:22:46.371333+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `catch' 2016-04-29T12:22:46.371360+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `call' 2016-04-29T12:22:46.371388+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/rack-2.0.0.alpha/lib/rack/etag.rb:25:in `call' 2016-04-29T12:22:46.371413+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/rack-2.0.0.alpha/lib/rack/conditional_get.rb:25:in `call' 2016-04-29T12:22:46.371482+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/rack-2.0.0.alpha/lib/rack/head.rb:12:in `call' 2016-04-29T12:22:46.371499+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/middleware/callbacks.rb:38:in `block in call' 2016-04-29T12:22:46.371533+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:97:in `__run_callbacks__' 2016-04-29T12:22:46.371583+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:750:in `_run_call_callbacks' 2016-04-29T12:22:46.371610+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:90:in `run_callbacks' 2016-04-29T12:22:46.371638+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/middleware/callbacks.rb:36:in `call' 2016-04-29T12:22:46.371684+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/middleware/remote_ip.rb:79:in `call' 2016-04-29T12:22:46.371704+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call' 2016-04-29T12:22:46.371718+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' 2016-04-29T12:22:46.371754+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/rack/logger.rb:36:in `call_app' 2016-04-29T12:22:46.371774+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/rack/logger.rb:24:in `block in call' 2016-04-29T12:22:46.371791+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/tagged_logging.rb:70:in `block in tagged' 2016-04-29T12:22:46.371823+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/tagged_logging.rb:26:in `tagged' 2016-04-29T12:22:46.371856+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/tagged_logging.rb:70:in `tagged' 2016-04-29T12:22:46.371875+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/rack/logger.rb:24:in `call' 2016-04-29T12:22:46.371907+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/middleware/request_id.rb:24:in `call' 2016-04-29T12:22:46.371927+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/rack-2.0.0.alpha/lib/rack/runtime.rb:22:in `call' 2016-04-29T12:22:46.371946+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 2016-04-29T12:22:46.371977+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/middleware/executor.rb:12:in `call' 2016-04-29T12:22:46.372014+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta4/lib/action_dispatch/middleware/static.rb:136:in `call' 2016-04-29T12:22:46.372030+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/rack-2.0.0.alpha/lib/rack/sendfile.rb:111:in `call' 2016-04-29T12:22:46.372061+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/engine.rb:522:in `call' 2016-04-29T12:22:46.372082+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:224:in `call' 2016-04-29T12:22:46.372101+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/server.rb:569:in `handle_request' 2016-04-29T12:22:46.372120+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/server.rb:406:in `process_client' 2016-04-29T12:22:46.372159+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/server.rb:271:in `block in run' 2016-04-29T12:22:46.372178+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/thread_pool.rb:114:in `call' 2016-04-29T12:22:46.372231+00:00 app[web.1]: [b27dcc4b-1e84-4d49-ba85-928c3f60a2f3] vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/thread_pool.rb:114:in `block in spawn_thread' 2016-04-29T12:23:05.993904+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] Started DELETE "/auth/sign_out" for 109.229.68.244 at 2016-04-29 12:23:05 +0000 2016-04-29T12:23:05.997085+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] Processing by Overrides::SessionsController#destroy as json 2016-04-29T12:23:05.999668+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms) 2016-04-29T12:23:06.000859+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] 2016-04-29T12:23:06.001059+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] NoMethodError (undefined method `find_by_uid' for #<Class:0x007fd93e174750>): 2016-04-29T12:23:06.001126+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] 2016-04-29T12:23:06.001154+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.beta4/lib/active_record/dynamic_matchers.rb:21:in `method_missing' 2016-04-29T12:23:06.001181+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] vendor/bundle/ruby/2.2.0/bundler/gems/devise_token_auth-10863b31270b/app/controllers/devise_token_auth/concerns/set_user_by_token.rb:61:in `set_user_by_token' 2016-04-29T12:23:06.001207+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:382:in `block in make_lambda' 2016-04-29T12:23:06.001268+00:00 app[web.1]: [7cf80123-2e44-4901-839d-7b129cd53bd1] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta4/lib/active_support/callbacks.rb:150:in `call' 

NoMethodError (undefined method 'find_by_uid' for #<Class:0x007fd93e174750>) . find_by_uid - the method belonging to the devise_token_auth . What is most interesting, in development it works great. Here is the test method in the console:

development:

  irb(main):001:0> User.find_by_uid('demo') User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."uid" = $1 LIMIT $2 [["uid", "demo"], ["LIMIT", 1]] => #<User id: 2, provider: "username", uid: "demo"... 

production:

 irb(main):003:0* User.find_by_uid('demo') NoMethodError: undefined method `find_by_uid' for #<Class:0x007f6b5de1b020> from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.beta4/lib/active_record/dynamic_matchers.rb:21:in `method_missing' from (irb):3 from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/commands/console.rb:65:in `start' from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/commands/console_helper.rb:9:in `start' from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/commands/commands_tasks.rb:78:in `console' from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/commands/commands_tasks.rb:49:in `run_command!' from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.beta4/lib/rails/commands.rb:18:in `<top (required)>' from bin/rails:9:in `require' from bin/rails:9:in `<main> 

UPD # 1:

I did some research. In general, see for yourself:

Local server

 irb(main):004:0> User.first User Load (0.5ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1 [["LIMIT", 1]] => #<User id: 1, provider: "username", uid: "duke", encrypted_password: "$2a$11$zDviguprmYVa4SIZ1EDCE.2k9Ubbv7yOxtKuHOuxmjS...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_si gn_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, name: "Viktor", username: "duke", avatar: nil, tokens: {}, created_at: "2016-04-30 07:03:51", updated_at: "2016-04-30 07:03:51"> 

Heroku

 irb(main):003:0* User.first User Load (3.9ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1 [["LIMIT", 1]] => #<User id: 1, name: "John Demo", username: "demo", encrypted_password: "$2a$11$JR9WpVBwFIre/p/Q0kYnt.mrwIShjZGZEoS2KTboFWS...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, created_at: "2016-04-13 15:44:39", updated_at: "2016-04-13 15:44:39"> 

On Heroku, in my model, all the attributes obtained from devise_token_auth are simply missing, which leads me to the idea that it simply does not work.

I suspect the problem is that I use the gem directly from the repository ( and this is why )

 gem 'devise_token_auth', github:"lynndylanhurley/devise_token_auth", branch: "master" 

Although it is installed during deployment (see the build log), it still behaves as if it is not there.

Build log

 ... Using devise_token_auth 0.1.37 from git://github.com/lynndylanhurley/devise_token_auth.git (at master@10863b3) ... 
  • And in the production of User.class, what does it return? - cheops
  • one
    I'm not saying that this is a problem, it’s just not yet clear which way to dig. Try one more thing: take the last class object and look at its methods User.last.methods.sort.each {| x | puts x}; nil; Perhaps there will be some additional information to think about why this is happening. - cheops
  • one
    @cheops uh, what? O_o User , as a model class, is of type Class , with no options. - D-side
  • one
    Try in development and production to look at the output of User.columns.map {|x|[x.name, x.sql_type]} - D-side
  • 2
    This joke just displays the columns in a real table :) Describe, it will not be worse. These methods (dynamic finders) are generated by the set of columns in the table, and they may not be present if there are not enough columns. This fact is specified in the documentation, but it would be nice to fix it here. - D-side

0