Rails migration error: Wrong number of arguments - ruby-on-rails

I just cloned a repository, so I am trying to setup locally, I get this strange error whenever I run rails db:migrate, I have searched for a solution but none on here meets my need.
I have been particularly confused at this because it is my first time using rails 6.0 and I cannot tell if it is an issue with rails or something is wrong in the code, although following the trace the issue seems to be with the timestamps type but I do not know what to do
Error
DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
>> Coffee::Rails::TemplateHandler.call(template)
To:
>> Coffee::Rails::TemplateHandler.call(template, source)
(called from <main> at /home/noriodebrume/crowdfrica/config/application.rb:7)
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
== 20160807112612 CreateProjects: migrating ===================================
-- create_table(:projects, {:id=>:integer})
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
wrong number of arguments (given 1, expected 0)
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:20:in `timestamps'
/home/noriodebrume/crowdfrica/db/migrate/20160807112612_create_projects.rb:8:in `block in change'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:44:in `block in create_table'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:882:in `block in method_missing'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:850:in `block in say_with_time'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:850:in `say_with_time'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:871:in `method_missing'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:44:in `create_table'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:104:in `create_table'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:142:in `create_table'
/home/noriodebrume/crowdfrica/db/migrate/20160807112612_create_projects.rb:3:in `change'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:820:in `exec_migration'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:804:in `block (2 levels) in migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:803:in `block in migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:802:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:992:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1300:in `block in execute_migration_in_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1351:in `block in ddl_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in `block in transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/transaction.rb:272:in `block in within_new_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/transaction.rb:270:in `within_new_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in `transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/transactions.rb:212:in `transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1351:in `ddl_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1299:in `execute_migration_in_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1271:in `block in migrate_without_lock'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1270:in `each'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1270:in `migrate_without_lock'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1218:in `block in migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1371:in `with_advisory_lock'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1218:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1051:in `up'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1026:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/tasks/database_tasks.rb:226:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/railties/databases.rake:83:in `block (3 levels) in <main>'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/railties/databases.rake:81:in `each'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/railties/databases.rake:81:in `block (2 levels) in <main>'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/command.rb:48:in `invoke'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands.rb:18:in `<main>'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:302:in `block in require'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:268:in `load_dependency'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:302:in `require'
bin/rails:4:in `<main>'
Caused by:
ArgumentError: wrong number of arguments (given 1, expected 0)
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:20:in `timestamps'
/home/noriodebrume/crowdfrica/db/migrate/20160807112612_create_projects.rb:8:in `block in change'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:44:in `block in create_table'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:882:in `block in method_missing'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:850:in `block in say_with_time'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:850:in `say_with_time'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:871:in `method_missing'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:44:in `create_table'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:104:in `create_table'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration/compatibility.rb:142:in `create_table'
/home/noriodebrume/crowdfrica/db/migrate/20160807112612_create_projects.rb:3:in `change'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:820:in `exec_migration'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:804:in `block (2 levels) in migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:803:in `block in migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:802:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:992:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1300:in `block in execute_migration_in_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1351:in `block in ddl_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in `block in transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/transaction.rb:272:in `block in within_new_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/transaction.rb:270:in `within_new_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in `transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/transactions.rb:212:in `transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1351:in `ddl_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1299:in `execute_migration_in_transaction'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1271:in `block in migrate_without_lock'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1270:in `each'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1270:in `migrate_without_lock'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1218:in `block in migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1371:in `with_advisory_lock'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1218:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1051:in `up'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/migration.rb:1026:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/tasks/database_tasks.rb:226:in `migrate'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/railties/databases.rake:83:in `block (3 levels) in <main>'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/railties/databases.rake:81:in `each'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.0.rc1/lib/active_record/railties/databases.rake:81:in `block (2 levels) in <main>'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/command.rb:48:in `invoke'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands.rb:18:in `<main>'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:302:in `block in require'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:268:in `load_dependency'
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:302:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
Here is the exact migration it points to:
class CreateProjects < ActiveRecord::Migration[5.0]
def change
create_table :projects do |t|
t.string :procect_name, null: false
t.numeric :project_goal
t.text :prgoject_headline
t.text :prgoject_description
t.timestamps :expires_at
t.timestamps
end
end
end
I want to add that ruby 2.6.3 is used for this project and this warning shows up whenever I run a migration:
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sprockets-3.6.3/lib/sprockets/digest_utils.rb:47: warning: constant ::Fixnum is deprecated
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sprockets-3.6.3/lib/sprockets/digest_utils.rb:51: warning: constant ::Bignum is deprecated
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:110: warning: constant ::Fixnum is deprecated
/home/noriodebrume/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:111: warning: constant ::Bignum is deprecated

t.timestamps doesn't accept timestamp name, just hash/keyword arguments:
timestamps(options = {})
Adds timestamps (created_at and updated_at) columns to the table.
t.timestamps(null: false)
Docs
If you want to add expires_at, you need to add it using a correct date type (e.g. datetime:
class CreateProjects < ActiveRecord::Migration[5.0]
def change
create_table :projects do |t|
# ...
t.datetime :expires_at
end
end
end

Related

Rail6 db:migrate fails - wrong number of arguments (given 1, expected 0)

I am unable to create tables (i.e. run db:migrate successfully) in Rail 6 on Windows 7.
Just in case I completely reinstalled rails by Installing Ruby 2.6 development pack and doing a 'gem install rails' which for me installed Rails 6.0.3.1
I created a new project and the first thing did was generate a 'Customer' model after which I ran the db:migrate command immediately after it failed saying the 'wrong number of arguments were given'. See below.
C:\Apps\rails>cd cmdb
C:\Apps\rails\cmdb>rails generate model Customer string:name
invoke active_record
create db/migrate/20200525080817_create_customers.rb
create app/models/customer.rb
invoke test_unit
create test/models/customer_test.rb
create test/fixtures/customers.yml
C:\Apps\rails\cmdb>rails db:migrate
== 20200525080817 CreateCustomers: migrating ==================================
-- create_table(:customers)
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
wrong number of arguments (given 1, expected 0)
C:/Apps/rails/cmdb/db/migrate/20200525080817_create_customers.rb:4:in `block in change'
C:/Apps/rails/cmdb/db/migrate/20200525080817_create_customers.rb:3:in `change'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Caused by:
ArgumentError: wrong number of arguments (given 1, expected 0)
C:/Apps/rails/cmdb/db/migrate/20200525080817_create_customers.rb:4:in `block in change'
C:/Apps/rails/cmdb/db/migrate/20200525080817_create_customers.rb:3:in `change'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
The migration.rb was generated and is shown below:-
class CreateCustomers < ActiveRecord::Migration[6.0]
def change
create_table :customers do |t|
t.name :string
t.timestamps
end
end
end
The re-run with a full trace is pasted below:-
C:\Apps\rails\cmdb>rails db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
== 20200525080817 CreateCustomers: migrating ==================================
-- create_table(:customers)
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
wrong number of arguments (given 1, expected 0)
C:/Apps/rails/cmdb/db/migrate/20200525080817_create_customers.rb:4:in `block in change'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:890:in `block in method_missing'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:858:in `block in say_with_time'
C:/Ruby26-x64/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:858:in `say_with_time'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:879:in `method_missing'
C:/Apps/rails/cmdb/db/migrate/20200525080817_create_customers.rb:3:in `change'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:828:in `exec_migration'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:812:in `block (2 levels) in migrate'
C:/Ruby26-x64/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:811:in `block in migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:810:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1002:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1361:in `block in ddl_transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in tra
nsaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_
transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in
synchronize'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchroniz
e'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transacti
on'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:212:in `transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1361:in `ddl_transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1281:in `block in migrate_without_lock'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1280:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1280:in `migrate_without_lock'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1231:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1061:in `up'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1036:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <top (required)>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/railties/databases.rake:84:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <top (required)>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
C:/Ruby26-x64/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.3.1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.3.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.3.1/lib/rails/command.rb:48:in `invoke'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.3.1/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Caused by:
ArgumentError: wrong number of arguments (given 1, expected 0)
C:/Apps/rails/cmdb/db/migrate/20200525080817_create_customers.rb:4:in `block in change'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:890:in `block in method_missing'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:858:in `block in say_with_time'
C:/Ruby26-x64/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:858:in `say_with_time'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:879:in `method_missing'
C:/Apps/rails/cmdb/db/migrate/20200525080817_create_customers.rb:3:in `change'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:828:in `exec_migration'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:812:in `block (2 levels) in migrate'
C:/Ruby26-x64/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:811:in `block in migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:810:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1002:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1361:in `block in ddl_transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in tra
nsaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_
transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in
synchronize'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchroniz
e'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transacti
on'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:212:in `transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1361:in `ddl_transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1281:in `block in migrate_without_lock'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1280:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1280:in `migrate_without_lock'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1231:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1061:in `up'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/migration.rb:1036:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <top (required)>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/railties/databases.rake:84:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <top (required)>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
C:/Ruby26-x64/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.3.1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.3.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.3.1/lib/rails/command.rb:48:in `invoke'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.3.1/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
C:\Apps\rails\cmdb>
In case anyone else is wondering why else this could be:
I generated a migration with the same name as my model and started to get TypeError: superclass mismatch for class MyCustomClassName error. Then I renamed the migration class to CreateMyCustomClassNameTable but left its file name the same 20201217095257_my_custom_class_name.rb which produced ArgumentError: wrong number of arguments (given 2, expected 0..1) error. Renaming file to 20201217095257_create_my_custom_class_name_table.rb fixes the problem for me.
You have generated migration wrongly.
The column name comes first and it's data type follows it. Compare following with the command you used.
rails generate model Customer name:string
You can quickly fix it by running
rails destroy model Customer
and then re generate migration using the generate command I shared above.
I recently ran into a similar issue, below is the error that I got:
-- create_table(:workers)
rails aborted!
StandardError: An error has occurred, all later migrations canceled:
wrong number of arguments (given 1, expected 0)
/home/wint3r/Learn/RubyOnRails/AssetManager/db/migrate/20210516062205_create_workers.rb:9:in `block in change'
/home/wint3r/Learn/RubyOnRails/AssetManager/db/migrate/20210516062205_create_workers.rb:3:in `change'
/home/wint3r/Learn/RubyOnRails/AssetManager/bin/rails:5:in `<top (required)>'
/home/wint3r/Learn/RubyOnRails/AssetManager/bin/spring:10:in `block in <top (required)>'
/home/wint3r/Learn/RubyOnRails/AssetManager/bin/spring:7:in `<top (required)>'
Caused by:
ArgumentError: wrong number of arguments (given 1, expected 0)
/home/wint3r/Learn/RubyOnRails/AssetManager/db/migrate/20210516062205_create_workers.rb:9:in `block in change'
/home/wint3r/Learn/RubyOnRails/AssetManager/db/migrate/20210516062205_create_workers.rb:3:in `change'
/home/wint3r/Learn/RubyOnRails/AssetManager/bin/rails:5:in `<top (required)>'
/home/wint3r/Learn/RubyOnRails/AssetManager/bin/spring:10:in `block in <top (required)>'
/home/wint3r/Learn/RubyOnRails/AssetManager/bin/spring:7:in `<top (required)>'
Tasks: TOP => db:migrate
In my case issue occurred because I tried to use t.timestamps for a custom datetime field 'emp_joining_date', I solved it by changing the type from t.timestamps to t.datetime

Rails Money migration fails

I am trying to import all migrations. However, the use of t.monetize :total, currency: { present: false } within a create_table block seems to crash with the following error message:
class AddAddressAndOrder < ActiveRecord::Migration[5.1]
def change
create_table :line_items do |t|
t.belongs_to :order
t.integer :quantity, default: 0
t.monetize :price, currency: { present: false }
t.monetize :total, currency: { present: false }
t.timestamps
end
end
end
*** ArgumentError Exception: wrong number of arguments (given 1, expected 2..3)
Each time I get to a t.monetize (or t.money) column reference I receive the same error... added below (including --trace):
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20160901101357 AddAddressAndOrder: migrating ===============================
-- create_table(:orders)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
wrong number of arguments (given 1, expected 2..3)
schema_definitions.rb:311:in `column'
table_pg_rails4.rb:9:in `block in monetize'
table_pg_rails4.rb:6:in `each'
table_pg_rails4.rb:6:in `monetize'
/Users/Paul/folder/Sites/project/db/migrate/20160901101357_add_address_and_order.rb:20:in `block in change'
schema_statements.rb:282:in `create_table'
abstract_mysql_adapter.rb:363:in `create_table'
method_missing'
say_with_time'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:818:in `say_with_time'
`method_missing'
/Users/Paul/folder/Sites/project/db/migrate/20160901101357_add_address_and_order.rb:18:in `change'
`exec_migration'
migrate'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
migrate'
connection_pool.rb:408:in `with_connection'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:774:in `migrate'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:953:in `migrate'
execute_migration_in_transaction'
`ddl_transaction'
`execute_migration_in_transaction'
migrate_without_lock'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `each'
`migrate_without_lock'
migrate'
`with_advisory_lock'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `migrate'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:1007:in `up'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:985:in `migrate'
`migrate'
levels) in <top (required)>'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
invoke_with_call_chain'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
`invoke_with_call_chain'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:160:in `invoke_task'
top_level'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:116:in `each'
top_level'
`run_with_threads'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:110:in `top_level'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:83:in `block in run'
`standard_exception_handling'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/Users/Paul/.rvm/gems/ruby-2.5.0#global/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/Users/Paul/.rvm/rubies/ruby-2.5.0/bin/rake:23:in `load'
/Users/Paul/.rvm/rubies/ruby-2.5.0/bin/rake:23:in `<main>'
Caused by:
ArgumentError: wrong number of arguments (given 1, expected 2..3)
schema_definitions.rb:311:in `column'
table_pg_rails4.rb:9:in `block in monetize'
table_pg_rails4.rb:6:in `each'
table_pg_rails4.rb:6:in `monetize'
/Users/Paul/folder/Sites/project/db/migrate/20160901101357_add_address_and_order.rb:20:in `block in change'
schema_statements.rb:282:in `create_table'
abstract_mysql_adapter.rb:363:in `create_table'
method_missing'
say_with_time'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:818:in `say_with_time'
`method_missing'
/Users/Paul/folder/Sites/project/db/migrate/20160901101357_add_address_and_order.rb:18:in `change'
`exec_migration'
migrate'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
migrate'
connection_pool.rb:408:in `with_connection'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:774:in `migrate'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:953:in `migrate'
execute_migration_in_transaction'
`ddl_transaction'
`execute_migration_in_transaction'
migrate_without_lock'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `each'
`migrate_without_lock'
migrate'
`with_advisory_lock'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `migrate'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:1007:in `up'
/Users/Paul/.rvm/gems/ruby-2.5.0#project/gems/activerecord-5.1.4/lib/active_record/migration.rb:985:in `migrate'
`migrate'
levels) in <top (required)>'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
invoke_with_call_chain'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
`invoke_with_call_chain'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:160:in `invoke_task'
top_level'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:116:in `each'
top_level'
`run_with_threads'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:110:in `top_level'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:83:in `block in run'
`standard_exception_handling'
/Users/Paul/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/Users/Paul/.rvm/gems/ruby-2.5.0#global/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/Users/Paul/.rvm/rubies/ruby-2.5.0/bin/rake:23:in `load'
/Users/Paul/.rvm/rubies/ruby-2.5.0/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate
My Gemfile.lock looks like this regarding Money-Rails:
money (~> 6.10.1)
money-rails (1.10.0)
activesupport (>= 3.0)
monetize (~> 1.7.0)
money (~> 6.10.0)
railties (>= 3.0)
The docs (https://github.com/RubyMoney/money-rails#migration-helpers) state that this should be fine. So I've no idea what to do.
The issue seems to be within the MoneyRails::ActiveRecord::Migration::Table.monetize method:
module MoneyRails
module ActiveRecord
module MigrationExtensions
module Table
def monetize(accessor, options={})
[:amount, :currency].each do |attribute|
column_present, _, *opts = OptionsExtractor.extract attribute, :no_table, accessor, options
column(*opts) if column_present
end
end
# Removed for brevity
end
end
end
end
No matter what is passed to monetize, it always seems to throw the same error. I really am lost as to what I am doing wrong, so any help would be greatly appreciated.
Are you doing anything in an initializer that might affect the MoneyRails::Configuration#amount_column? Looks like the OptionsExtractor is missing a few things.

Can't migrate psql database after scaffold - Cloud9

I am getting an "wrong number of arguments (given 1, expected 0)" error when trying to run rake db:migrate on my psql database. This asker had the same trouble, but locking my Gemfile "to gem 'arel', '6.0.0.beta2'" and using rails version 4.2.0.beta4 hasn't fixed the issue though I am able to bundle and am absolutely using these versions. Any help would be much appreciated!
Here is the full trace
rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20161104230329 Createmytable: migrating ==================================
-- create_table(:mytable)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
wrong number of arguments (given 1, expected 0)
/home/ubuntu/workspace/mydb_api/db/migrate/20161104230329_create_mytable.rb:4:in `block in change'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/schema_statements.rb:199:in `create_table'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:655:in `block in method_missing'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:625:in `block in say_with_time'
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:625:in `say_with_time'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:645:in `method_missing'
/home/ubuntu/workspace/mydb_api/db/migrate/20161104230329_create_mytable.rb:3:in `change'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:599:in `exec_migration'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:583:in `block (2 levels) in migrate'
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:582:in `block in migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:581:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:758:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:984:in `block in execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1030:in `block in ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:218:in `transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1030:in `ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:983:in `execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:945:in `block in migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:941:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:941:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:813:in `up'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:791:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:248:in `block in execute'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `execute'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:180:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:173:in `invoke'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:152:in `invoke_task'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block in top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:117:in `run_with_threads'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:102:in `top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:80:in `block in run'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in `<main>'
ArgumentError: wrong number of arguments (given 1, expected 0)
/home/ubuntu/workspace/mydb_api/db/migrate/20161104230329_create_mytable.rb:4:in `block in change'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/schema_statements.rb:199:in `create_table'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:655:in `block in method_missing'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:625:in `block in say_with_time'
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:625:in `say_with_time'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:645:in `method_missing'
/home/ubuntu/workspace/mydb_api/db/migrate/20161104230329_create_mytable.rb:3:in `change'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:599:in `exec_migration'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:583:in `block (2 levels) in migrate'
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:582:in `block in migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:581:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:758:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:984:in `block in execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1030:in `block in ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:218:in `transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1030:in `ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:983:in `execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:945:in `block in migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:941:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:941:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:813:in `up'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:791:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0.beta4/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:248:in `block in execute'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `execute'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:180:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/task.rb:173:in `invoke'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:152:in `invoke_task'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block in top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:117:in `run_with_threads'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:102:in `top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:80:in `block in run'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate
Here is the file 20161104230329_create_mytable.rb
class CreateTables < ActiveRecord::Migration
def change
create_table :mytable do |t|
t.name :string
t.param1 :integer
t.param2 :integer
t.param3 :integer
t.timestamps null: false
end
end
end
You have the order of the field/field type options of your migration reversed. Should be
class CreateTables < ActiveRecord::Migration
def change
create_table :mytable do |t|
t.string :name
t.integer :param1
t.timestamps
end
end
end

Rails ActiveRecord Migration ArgumentError

I have a problem while running rake db:migrate to create a new table(migration file generated by rails g model).
class CreateReminderLogs < ActiveRecord::Migration
def change
create_table :reminder_logs do |t|
t.string :remindable_type
t.integer :remindable_id
t.integer :user_id
t.string :remindable_email
t.datetime :reminder_sent_at
t.timestamps
end
add_index :reminder_logs, :user_id
add_index :reminder_logs, :remindable_id
end
end
After adding --trace option to my command it shows up the stack as shown below. Seems like the error is related to foreign key but I didn't specify any foreign key attribute in this migration.
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20151119105903 CreateReminderLogs: migrating ===============================
-- create_table(:reminder_logs)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
wrong number of arguments (4 for 1..2)/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/foreigner-1.6.1/lib/foreigner/connection_adapters/abstract/table_definition.rb:4:in `foreign_key'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/connection_adapters/table_definition.rb:159:in `add_foreign_key'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/column_options_handler.rb:24:in `schema_plus_handle_column_options'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/connection_adapters/table_definition.rb:127:in `column_with_schema_plus'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/schema_definitions.rb:234:in `block (3 levels) in <class:TableDefinition>'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/schema_definitions.rb:234:in `each'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/schema_definitions.rb:234:in `block (2 levels) in <class:TableDefinition>'
/Users/nayiaw/Documents/workspace/my-resipi/db/migrate/20151119105903_create_reminder_logs.rb:5:in `block in change'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/foreigner-1.6.1/lib/foreigner/connection_adapters/abstract/schema_statements.rb:16:in `call'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/foreigner-1.6.1/lib/foreigner/connection_adapters/abstract/schema_statements.rb:16:in `block in create_table'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:42:in `block in create_table_with_schema_plus'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/schema_statements.rb:198:in `create_table'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:37:in `create_table_with_schema_plus'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/foreigner-1.6.1/lib/foreigner/connection_adapters/abstract/schema_statements.rb:14:in `create_table'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:460:in `create_table'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:656:in `block in method_missing'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:628:in `block in say_with_time'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:628:in `say_with_time'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:648:in `method_missing'
/Users/nayiaw/Documents/workspace/my-resipi/db/migrate/20151119105903_create_reminder_logs.rb:3:in `change'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:602:in `exec_migration'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:586:in `block (2 levels) in migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:585:in `block in migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:584:in `migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:759:in `migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:1046:in `ddl_transaction'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:959:in `block in migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:955:in `each'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:955:in `migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:814:in `up'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:792:in `migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/Users/nayiaw/.rbenv/versions/2.1.2/bin/rake:23:in `load'
/Users/nayiaw/.rbenv/versions/2.1.2/bin/rake:23:in `<main>'
ArgumentError: wrong number of arguments (4 for 1..2)
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/foreigner-1.6.1/lib/foreigner/connection_adapters/abstract/table_definition.rb:4:in `foreign_key'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/connection_adapters/table_definition.rb:159:in `add_foreign_key'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/column_options_handler.rb:24:in `schema_plus_handle_column_options'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/connection_adapters/table_definition.rb:127:in `column_with_schema_plus'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/schema_definitions.rb:234:in `block (3 levels) in <class:TableDefinition>'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/schema_definitions.rb:234:in `each'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/schema_definitions.rb:234:in `block (2 levels) in <class:TableDefinition>'
/Users/nayiaw/Documents/workspace/my-resipi/db/migrate/20151119105903_create_reminder_logs.rb:5:in `block in change'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/foreigner-1.6.1/lib/foreigner/connection_adapters/abstract/schema_statements.rb:16:in `call'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/foreigner-1.6.1/lib/foreigner/connection_adapters/abstract/schema_statements.rb:16:in `block in create_table'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:42:in `block in create_table_with_schema_plus'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/schema_statements.rb:198:in `create_table'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/schema_plus-1.5.1/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:37:in `create_table_with_schema_plus'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/foreigner-1.6.1/lib/foreigner/connection_adapters/abstract/schema_statements.rb:14:in `create_table'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:460:in `create_table'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:656:in `block in method_missing'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:628:in `block in say_with_time'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:628:in `say_with_time'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:648:in `method_missing'
/Users/nayiaw/Documents/workspace/my-resipi/db/migrate/20151119105903_create_reminder_logs.rb:3:in `change'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:602:in `exec_migration'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:586:in `block (2 levels) in migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:585:in `block in migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:584:in `migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:759:in `migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:1046:in `ddl_transaction'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:959:in `block in migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:955:in `each'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:955:in `migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:814:in `up'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/migration.rb:792:in `migrate'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.13/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/Users/nayiaw/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/Users/nayiaw/.rbenv/versions/2.1.2/bin/rake:23:in `load'
/Users/nayiaw/.rbenv/versions/2.1.2/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate
I thought this problem is similar to this SO question but judging from the stacktrace it seems different. I've tried update the arel gem to version >= 6.0.3 but it has compatibility error.
Bundler could not find compatible versions for gem "arel":
In Gemfile:
default_value_for (~> 3.0.0) ruby depends on
activerecord (< 5.0, >= 3.2.0) ruby depends on
arel (~> 5.0.0) ruby
arel (>= 6.0.3, ~> 6.0) ruby
The Rails version of this project is '4.1.13'.
Please help me as I couldn't find any solution online. Thanks in advance.
It would appear that the SchemaPlus gem is interfering with your index adding code. You could adjust your migration to look like:
class CreateReminderLogs < ActiveRecord::Migration
def change
create_table :reminder_logs do |t|
t.string :remindable_type
t.integer :remindable_id, index: true
t.integer :user_id, index: true
t.string :remindable_email
t.datetime :reminder_sent_at
t.timestamps
end
end
end

Why am I being asked to RUN 'rake db:migrate RAILS_ENV=test'?

I've been following the tutorial "Multitenancy with Rails" by Ryan Bigg https://leanpub.com/multi-tenancy-rails.
Though I have run rake db:migrate I keep getting an error Migrations are pending. To resolve this issue run bin/rake db:migrate RAILS_ENV=test
If I do that I get another set of errors.
Since I don't have enough reputation, I can't post the images here.
If anyone has seen the book, I'm getting the error after adding the add_owner_id_to_accounts migration.
Any help would be really appreciated. Thanks!
This is the error I am getting:
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:392:in `check_pending!': (ActiveRecord::PendingMigrationError)
Migrations are pending. To resolve this issue, run:
bin/rake db:migrate RAILS_ENV=test
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:405:in `load_schema_if_pending!'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:411:in `block in maintain_test_schema!'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:639:in `suppress_messages'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:416:in `method_missing'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:411:in `maintain_test_schema!'
from /home/nikhil/workspace2/subscribem/spec/rails_helper.rb:29:in `<top (required)>'
from /home/nikhil/workspace2/subscribem/spec/features/accounts/sign_up_spec.rb:1:in `require'
from /home/nikhil/workspace2/subscribem/spec/features/accounts/sign_up_spec.rb:1:in `<top (required)>'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:in `load'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:in `block in load_spec_files'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1325:in `each'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1325:in `load_spec_files'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:102:in `setup'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:88:in `run'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:73:in `run'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:41:in `invoke'
from /home/nikhil/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.3.1/exe/rspec:4:in `<top (required)>'
from /home/nikhil/.rvm/gems/ruby-2.2.2/bin/rspec:23:in `load'
from /home/nikhil/.rvm/gems/ruby-2.2.2/bin/rspec:23:in `<main>'
from /home/nikhil/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
from /home/nikhil/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'
And this is what I'm getting if I run rake db:migrate RAILS_ENV=test(as the output asks me to)
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/tasks/statistics.rake:4: warning: already initialized constant STATS_DIRECTORIES
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/railties-4.2.3/lib/rails/tasks/statistics.rake:4: warning: previous definition of STATS_DIRECTORIES was here
== 20150627112900 CreateSubscribemAccounts: migrating =========================
-- create_table(:subscribem_accounts)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: table "subscribem_accounts" already exists: CREATE TABLE "subscribem_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) /home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `new'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `prepare'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:134:in `execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:329:in `block in execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:329:in `execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:208:in `create_table'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:661:in `block in method_missing'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:631:in `block in say_with_time'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:631:in `say_with_time'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:651:in `method_missing'
/home/nikhil/workspace2/subscribem/db/migrate/20150627112900_create_subscribem_accounts.rb:3:in `change'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:605:in `exec_migration'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:589:in `block (2 levels) in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:588:in `block in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:587:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:764:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:994:in `block in execute_migration_in_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:1040:in `block in ddl_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:220:in `transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:1040:in `ddl_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:993:in `execute_migration_in_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:955:in `block in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:951:in `each'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:951:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:819:in `up'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:797:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
ActiveRecord::StatementInvalid: SQLite3::SQLException: table "subscribem_accounts" already exists: CREATE TABLE "subscribem_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `new'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `prepare'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:134:in `execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:329:in `block in execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:329:in `execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:208:in `create_table'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:661:in `block in method_missing'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:631:in `block in say_with_time'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:631:in `say_with_time'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:651:in `method_missing'
/home/nikhil/workspace2/subscribem/db/migrate/20150627112900_create_subscribem_accounts.rb:3:in `change'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:605:in `exec_migration'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:589:in `block (2 levels) in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:588:in `block in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:587:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:764:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:994:in `block in execute_migration_in_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:1040:in `block in ddl_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:220:in `transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:1040:in `ddl_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:993:in `execute_migration_in_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:955:in `block in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:951:in `each'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:951:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:819:in `up'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:797:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
SQLite3::SQLException: table "subscribem_accounts" already exists
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `new'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `prepare'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:134:in `execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:329:in `block in execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:329:in `execute'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:208:in `create_table'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:661:in `block in method_missing'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:631:in `block in say_with_time'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:631:in `say_with_time'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:651:in `method_missing'
/home/nikhil/workspace2/subscribem/db/migrate/20150627112900_create_subscribem_accounts.rb:3:in `change'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:605:in `exec_migration'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:589:in `block (2 levels) in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:588:in `block in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:587:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:764:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:994:in `block in execute_migration_in_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:1040:in `block in ddl_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/transactions.rb:220:in `transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:1040:in `ddl_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:993:in `execute_migration_in_transaction'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:955:in `block in migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:951:in `each'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:951:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:819:in `up'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/migration.rb:797:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/home/nikhil/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate => app:db:migrate
(See full trace by running task with --trace)
In test_helper.rb -
ActiveRecord::Migration.maintain_test_schema!
This maintains your test database every time, whenever you run your tests.
It seem that the source of problem is here :
SQLite3::SQLException: table "subscribem_accounts" already exists
subscribem_accounts table seem already existing, and it's like you're trying to create it twice, so try to reset the database :
rake db:reset
this command will drop your actual database, and recreate it again for you

Resources