Skip to content

[Error] users#token (NoMethodError) "undefined method`find_or_create_by_device_id' for #<Class:0x000000023d4558>" #216

@ShiningRay

Description

@ShiningRay
A NoMethodError occurred in users#token:

  undefined method `find_or_create_by_device_id' for #<Class:0x000000023d4558>
  activerecord (4.2.3) lib/active_record/dynamic_matchers.rb:26:in `method_missing'


-------------------------------
Request:
-------------------------------

  * URL        : http://bling0.com/token
  * HTTP Method: POST
  * IP address : 14.157.96.49
  * Parameters : {"device_id"=>"FFFFFFFF29768EAC9A1E4DF4BCCACCE936AB76CC", "token"=>"<8b325d39 5057211a 18a09bd6 434a0ca1 f455446a f64c895d 5392328c e2b833e2>", "controller"=>"users", "action"=>"token"}
  * Timestamp  : 2015-07-23 22:02:22 +0800
  * Server : shiningray
  * Rails root : /home/deploy/releases/20150722121133
  * Process: 14839

-------------------------------
Session:
-------------------------------

  * session id: nil
  * data: {}

-------------------------------
Environment:
-------------------------------

  * CONTENT_LENGTH                              : 130
  * CONTENT_TYPE                                : application/x-www-form-urlencoded
  * GATEWAY_INTERFACE                           : CGI/1.2
  * HTTP_ACCEPT                                 : */*
  * HTTP_ACCEPT_ENCODING                        : gzip, deflate
  * HTTP_ACCEPT_LANGUAGE                        : zh-cn
  * HTTP_CONNECTION                             : close
  * HTTP_HOST                                   : bling0.com
  * HTTP_USER_AGENT                             : bling0/1.0 CFNetwork/672.1.15 Darwin/14.0.0
  * HTTP_VERSION                                : HTTP/1.0
  * HTTP_X_FORWARDED_FOR                        : 14.157.96.49
  * HTTP_X_REAL_IP                              : 14.157.96.49
  * ORIGINAL_FULLPATH                           : /token
  * ORIGINAL_SCRIPT_NAME                        : 
  * PATH_INFO                                   : /token
  * QUERY_STRING                                : 
  * REMOTE_ADDR                                 : 127.0.0.1
  * REQUEST_METHOD                              : POST
  * REQUEST_PATH                                : /token
  * REQUEST_URI                                 : /token
  * ROUTES_59628640_SCRIPT_NAME                 : 
  * SCRIPT_NAME                                 : 
  * SERVER_NAME                                 : bling0.com
  * SERVER_PORT                                 : 80
  * SERVER_PROTOCOL                             : HTTP/1.1
  * SERVER_SOFTWARE                             : 2.11.3
  * action_controller.instance                  : #<UsersController:0x0000000301cc20>
  * action_dispatch.backtrace_cleaner           : #<Rails::BacktraceCleaner:0x000000066f5490>
  * action_dispatch.cookies                     : #<ActionController::RequestForgeryProtection::ProtectionMethods::NullSession::NullCookieJar:0x00000002f3ca30>
  * action_dispatch.cookies_digest              : 
  * action_dispatch.cookies_serializer          : 
  * action_dispatch.encrypted_cookie_salt       : encrypted cookie
  * action_dispatch.encrypted_signed_cookie_salt: signed encrypted cookie
  * action_dispatch.http_auth_salt              : http authentication
  * action_dispatch.key_generator               : #<ActiveSupport::CachingKeyGenerator:0x000000060d27c0>
  * action_dispatch.logger                      : #<ActiveSupport::Logger:0x00000007282f10>
  * action_dispatch.parameter_filter            : [:password, :password_confirmation]
  * action_dispatch.redirect_filter             : []
  * action_dispatch.remote_ip                   : 14.157.96.49
  * action_dispatch.request.accepts             : [#<Mime::Type:0x0000000225d828 @synonyms=[], @symbol=nil, @string="*/*">]
  * action_dispatch.request.content_type        : application/x-www-form-urlencoded
  * action_dispatch.request.flash_hash          : 
  * action_dispatch.request.formats             : [#<Mime::Type:0x0000000225d828 @synonyms=[], @symbol=nil, @string="*/*">]
  * action_dispatch.request.parameters          : {"device_id"=>"FFFFFFFF29768EAC9A1E4DF4BCCACCE936AB76CC", "token"=>"<8b325d39 5057211a 18a09bd6 434a0ca1 f455446a f64c895d 5392328c e2b833e2>", "controller"=>"users", "action"=>"token"}
  * action_dispatch.request.path_parameters     : {:controller=>"users", :action=>"token"}
  * action_dispatch.request.query_parameters    : {}
  * action_dispatch.request.request_parameters  : {"device_id"=>"FFFFFFFF29768EAC9A1E4DF4BCCACCE936AB76CC", "token"=>"<8b325d39 5057211a 18a09bd6 434a0ca1 f455446a f64c895d 5392328c e2b833e2>"}
  * action_dispatch.request_id                  : 39021af5-2265-4df1-9815-64202d60ae43
  * action_dispatch.routes                      : #<ActionDispatch::Routing::RouteSet:0x000000071bb8c0>
  * action_dispatch.secret_key_base             : 58b4444402f3fbceb25ffa10e20d0a99c65c75ca4ff1d66488bc2814650918027cb727947327a6f68571726457f7b43da5cc4806e75dcf8351dc14291f3f36c1
  * action_dispatch.secret_token                : 
  * action_dispatch.show_detailed_exceptions    : true
  * action_dispatch.show_exceptions             : true
  * action_dispatch.signed_cookie_salt          : signed cookie
  * newrelic.transaction_started                : true
  * puma.config                                 : #<Puma::Configuration:0x00000002373258>
  * puma.socket                                 : #<UNIXSocket:0x000000030f03b8>
  * rack.after_reply                            : []
  * rack.cors                                   : #<Rack::Cors::Result:0x000000030d8628>
  * rack.errors                                 : #<File:0x00000001569540>
  * rack.hijack                                 : #<Puma::Client:0x000000030f0368>
  * rack.hijack?                                : true
  * rack.input                                  : #<StringIO:0x000000030e8b18>
  * rack.multiprocess                           : false
  * rack.multithread                            : true
  * rack.request.form_hash                      : {"device_id"=>"FFFFFFFF29768EAC9A1E4DF4BCCACCE936AB76CC", "token"=>"<8b325d39 5057211a 18a09bd6 434a0ca1 f455446a f64c895d 5392328c e2b833e2>"}
  * rack.request.form_input                     : #<StringIO:0x000000030e8b18>
  * rack.request.form_vars                      : [FILTERED]
  * rack.request.query_hash                     : {}
  * rack.request.query_string                   : 
  * rack.run_once                               : false
  * rack.session                                : #<ActionController::RequestForgeryProtection::ProtectionMethods::NullSession::NullSessionHash:0x00000002f41c10>
  * rack.session.options                        : {:skip=>true}
  * rack.url_scheme                             : http
  * rack.version                                : [1, 3]

-------------------------------
Backtrace:
-------------------------------

  activerecord (4.2.3) lib/active_record/dynamic_matchers.rb:26:in `method_missing'
  app/controllers/users_controller.rb:35:in `token'
  actionpack (4.2.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.2.3) lib/abstract_controller/base.rb:198:in `process_action'
  actionpack (4.2.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.2.3) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.2.3) lib/active_support/callbacks.rb:115:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:115:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:553:in `block (2 levels) in compile'
  activesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:88:in `run_callbacks'
  actionpack (4.2.3) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.2.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.2.3) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.2.3) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.3) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (4.2.3) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.2.3) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.2.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.2.3) lib/abstract_controller/base.rb:137:in `process'
  actionview (4.2.3) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.2.3) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.2.3) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.2.3) lib/action_controller/metal.rb:237:in `block in action'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:76:in `call'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:45:in `serve'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:821:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  exception_notification (4.1.1) lib/exception_notification/rack.rb:32:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack-raw-upload (1.1.1) lib/rack/raw_upload.rb:18:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  simple_captcha2 (0.3.4) lib/simple_captcha/middleware.rb:26:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack (1.6.4) lib/rack/etag.rb:24:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack (1.6.4) lib/rack/conditionalget.rb:38:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack (1.6.4) lib/rack/head.rb:13:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/flash.rb:260:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  activerecord (4.2.3) lib/active_record/query_cache.rb:36:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
  actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  request_store (1.1.0) lib/request_store/middleware.rb:8:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  railties (4.2.3) lib/rails/engine.rb:518:in `call'
  railties (4.2.3) lib/rails/application.rb:165:in `call'
  railties (4.2.3) lib/rails/railtie.rb:194:in `public_send'
  railties (4.2.3) lib/rails/railtie.rb:194:in `method_missing'
  newrelic_rpm (3.12.1.298) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
  puma (2.11.3) lib/puma/configuration.rb:51:in `call'
  puma (2.11.3) lib/puma/server.rb:507:in `handle_request'
  puma (2.11.3) lib/puma/server.rb:375:in `process_client'
  puma (2.11.3) lib/puma/server.rb:262:in `block in run'
  puma (2.11.3) lib/puma/thread_pool.rb:104:in `call'
  puma (2.11.3) lib/puma/thread_pool.rb:104:in `block in spawn_thread'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions