Sign up not working: unknown attribute: user_id

56 views
Skip to first unread message

july

unread,
Sep 18, 2014, 1:01:18 AM9/18/14
to communi...@googlegroups.com
hi,
When creating a user, I got this error

 ActiveRecord::UnknownAttributeError in UsersController#create
unknown attribute: user_id                                                         

--------------------
Request

Parameters:
{"utf8"=>"✓",
 "authenticity_token"=>"7wgbOspSoqW0UPpdVz1iN56gYrf2lNYO0q2H4Wo5puc=",
 "user"=>{"login"=>"july2014",
 "email"=>"ju...@yahoo.com",
 "birthday(1i)"=>"1989",
 "birthday(2i)"=>"9",
 "birthday(3i)"=>"16",
 "password"=>"[FILTERED]",
 "password_confirmation"=>"[FILTERED]"},
 "inviter_id"=>"",
 "inviter_code"=>"",
 "commit"=>"Sign Up!"}


ruby -v 2.1.2
rails -v 2.3.9

july

unread,
Sep 25, 2014, 6:16:15 AM9/25/14
to communi...@googlegroups.com
error in server.log
-----------------

Started POST "/users" for 127.0.0.1 at 2014-09-16 07:53:17 -0700
Processing by UsersController#create as HTML
  Parameters: {"utf8"=>"?", "authenticity_token"=>"j9fjuCd8tj8WBEMrNbxx9PPv4TUtSA/R1Zg8lYFpeyE=", "user"=>{"login"=>"july", "email"=>"ju...@yahoo.com", "birthday(1i)"=>"1987", "birthday(2i)"=>"5", "birthday(3i)"=>"7", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "inviter_id"=>"", "inviter_code"=>"", "commit"=>"Sign Up!"}
[I18n] loading locale: en from config
[I18n] Locale set to en
   (0.3ms)  begin transaction
  User Exists (19.3ms)  SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER('ju...@yahoo.com') LIMIT 1
  User Exists (0.1ms)  SELECT 1 AS one FROM "users" WHERE LOWER("users"."login") = LOWER('july') LIMIT 1
  User Exists (0.2ms)  SELECT 1 AS one FROM "users" WHERE "users"."persistence_token" = 'd0b5e0adbafffa1ac887b4b9fd91e4f4a40ef9a31c7bb1d5c29ceb69cce5fce2dd0d936f5a64db1460a3757b5b2f0e3c1f6a8811c4bb1bb6a1bfd2c93bc859ae' LIMIT 1
  User Exists (0.2ms)  SELECT 1 AS one FROM "users" WHERE "users"."single_access_token" = '348vSOIBuIIq9fr8nf' LIMIT 1
  User Exists (0.2ms)  SELECT 1 AS one FROM "users" WHERE "users"."login" = 'mary1366' LIMIT 1
   (0.1ms)  rollback transaction
Completed 500 Internal Server Error in 293ms

ActiveRecord::UnknownAttributeError (unknown attribute: user_id):
  activerecord (3.2.9) lib/active_record/attribute_assignment.rb:88:in `block in assign_attributes'
  activerecord (3.2.9) lib/active_record/attribute_assignment.rb:78:in `each'
  activerecord (3.2.9) lib/active_record/attribute_assignment.rb:78:in `assign_attributes'
  activerecord (3.2.9) lib/active_record/associations/association.rb:235:in `block in build_record'
  activerecord (3.2.9) lib/active_record/base.rb:499:in `initialize'
  activerecord (3.2.9) lib/active_record/reflection.rb:183:in `new'
  activerecord (3.2.9) lib/active_record/reflection.rb:183:in `build_association'
  activerecord (3.2.9) lib/active_record/associations/association.rb:233:in `build_record'
  activerecord (3.2.9) lib/active_record/associations/collection_association.rb:112:in `build'
  activerecord (3.2.9) lib/active_record/associations/collection_proxy.rb:46:in `build'
  friendly_id (3.3.3.0) lib/friendly_id/active_record_adapter/slugged_model.rb:54:in `build_a_slug'
  activesupport (3.2.9) lib/active_support/callbacks.rb:407:in `_run__431220537__save__958594186__callbacks'
  activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
  activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
  activerecord (3.2.9) lib/active_record/callbacks.rb:264:in `create_or_update'
  activerecord (3.2.9) lib/active_record/persistence.rb:84:in `save'
  activerecord (3.2.9) lib/active_record/validations.rb:50:in `save'
  activerecord (3.2.9) lib/active_record/attribute_methods/dirty.rb:22:in `save'
  activerecord (3.2.9) lib/active_record/transactions.rb:259:in `block (2 levels) in save'
  activerecord (3.2.9) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
  activerecord (3.2.9) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
  activerecord (3.2.9) lib/active_record/transactions.rb:208:in `transaction'
  activerecord (3.2.9) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
  activerecord (3.2.9) lib/active_record/transactions.rb:259:in `block in save'
  activerecord (3.2.9) lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
  activerecord (3.2.9) lib/active_record/transactions.rb:258:in `save'
  community_engine (2.3.2) app/controllers/users_controller.rb:95:in `create'
  actionpack (3.2.9) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.9) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.9) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.9) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.9) lib/active_support/callbacks.rb:470:in `block in _run__438136660__process_action__980268308__callbacks'
  activesupport (3.2.9) lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_1636'
  community_engine (2.3.2) lib/community_engine/localized_application.rb:30:in `set_locale'
  activesupport (3.2.9) lib/active_support/callbacks.rb:214:in `_conditional_callback_around_1636'
  activesupport (3.2.9) lib/active_support/callbacks.rb:425:in `_run__438136660__process_action__980268308__callbacks'
  activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.9) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.9) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.9) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.9) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.9) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.9) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.9) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.9) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.9) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.9) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.9) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.9) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:601:in `call'
  rakismet (1.5.0) lib/rakismet/middleware.rb:10:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.9) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `_run__725916521__call__958594186__callbacks'
  activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.9) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.9) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.9) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.9) lib/rails/rack/logger.rb:16:in `call'
  request_store (1.1.0) lib/request_store/middleware.rb:8:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.9) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.9) lib/rails/engine.rb:479:in `call'
  railties (3.2.9) lib/rails/application.rb:223:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.9) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
  /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'


  Rendered /usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/_trace.erb (3.1ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.3ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (24.8ms)

Reply all
Reply to author
Forward
0 new messages