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
Related
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
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.
For some reason or another my Ruby on Rails application is telling me that it can't run migrations. I an unsure how to fix this. I created a table with no information by accident. I then tried to delete the migration file and the table that it created. When I try to run the migration command it gives me this error:
rails aborted!
Don't know how to build task 'db:migration' (see --tasks)
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/railties-5.0.0/lib/rails/commands/rake_proxy.rb:13:in `block in run_rake_task'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/railties-5.0.0/lib/rails/commands/rake_proxy.rb:10:in `run_rake_task'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
/home/ubuntu/workspace/saasapp/bin/rails:9:in `require'
/home/ubuntu/workspace/saasapp/bin/rails:9:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/spring-1.7.2/bin/spring:49:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>'
/home/ubuntu/workspace/saasapp/bin/spring:15:in `require'
/home/ubuntu/workspace/saasapp/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
(See full trace by running task with --trace)
Can someone please help me fix this issue. I need to remove the existing table so that I can create the correct one. It won't populate my schema file.
This is the error that I get when I run rake db:migrate
rake db:migrate
== 20170322214259 CreateProfiles: migrating ===================================
-- change_table(:profiles)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: Cannot add a NOT NULL column with default value NULL: ALTER TABLE "profiles" ADD "created_at" datetime NOT NULL
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in initialize'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:innew'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in prepare'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:137:inexecute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in block in execute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:566:inblock in log'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activesupport-5.0.0/lib/active_support/notifications/instrumenter.rb:21:in instrument'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:560:inlog'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in execute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:inadd_column'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:in add_column'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:1096:inadd_timestamps'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_definitions.rb:525:in timestamps'
/home/ubuntu/workspace/saasapp/db/migrate/20170322214259_create_profiles.rb:11:inblock in change'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:443:in change_table'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:845:inblock in method_missing'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:814:in block in say_with_time'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:814:insay_with_time'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:834:in method_missing'
/home/ubuntu/workspace/saasapp/db/migrate/20170322214259_create_profiles.rb:3:inchange'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:788:in exec_migration'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:772:inblock (2 levels) in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:771:in block in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:inwith_connection'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:770:in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:950:inmigrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1211:in block in execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1279:inblock in ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in block in transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/transaction.rb:189:inwithin_new_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/transactions.rb:211:intransaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1279:in ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1210:inexecute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1183:in block in migrate_without_lock'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1182:ineach'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1182:in migrate_without_lock'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1133:inmigrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1005:in up'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:983:inmigrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/tasks/database_tasks.rb:161:in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/railties/databases.rake:58:inblock (2 levels) in '
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/rake-12.0.0/exe/rake:27:in <top (required)>'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/bin/ruby_executable_hooks:15:ineval'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/bin/ruby_executable_hooks:15:in <main>'
ActiveRecord::StatementInvalid: SQLite3::SQLException: Cannot add a NOT NULL column with default value NULL: ALTER TABLE "profiles" ADD "created_at" datetime NOT NULL
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:ininitialize'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in new'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:inprepare'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:137:in execute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:inblock in execute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:566:in block in log'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activesupport-5.0.0/lib/active_support/notifications/instrumenter.rb:21:ininstrument'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:560:in log'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:inexecute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:in add_column'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:inadd_column'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:1096:in add_timestamps'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_definitions.rb:525:intimestamps'
/home/ubuntu/workspace/saasapp/db/migrate/20170322214259_create_profiles.rb:11:in block in change'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:443:inchange_table'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:845:in block in method_missing'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:814:inblock in say_with_time'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:814:in say_with_time'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:834:inmethod_missing'
/home/ubuntu/workspace/saasapp/db/migrate/20170322214259_create_profiles.rb:3:in change'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:788:inexec_migration'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:772:in block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:771:inblock in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in with_connection'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:770:inmigrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:950:in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1211:inblock in execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1279:in block in ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:232:inblock in transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/transaction.rb:189:in within_new_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:232:intransaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/transactions.rb:211:in transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1279:inddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1210:in execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1183:inblock in migrate_without_lock'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1182:in each'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1182:inmigrate_without_lock'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1133:in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1005:inup'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:983:in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/tasks/database_tasks.rb:161:inmigrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/railties/databases.rake:58:in block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/rake-12.0.0/exe/rake:27:in'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/bin/ruby_executable_hooks:15:in eval'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/bin/ruby_executable_hooks:15:in'
SQLite3::SQLException: Cannot add a NOT NULL column with default value NULL
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in initialize'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:innew'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in prepare'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:137:inexecute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in block in execute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:566:inblock in log'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activesupport-5.0.0/lib/active_support/notifications/instrumenter.rb:21:in instrument'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:560:inlog'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in execute'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:inadd_column'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:in add_column'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:1096:inadd_timestamps'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_definitions.rb:525:in timestamps'
/home/ubuntu/workspace/saasapp/db/migrate/20170322214259_create_profiles.rb:11:inblock in change'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:443:in change_table'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:845:inblock in method_missing'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:814:in block in say_with_time'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:814:insay_with_time'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:834:in method_missing'
/home/ubuntu/workspace/saasapp/db/migrate/20170322214259_create_profiles.rb:3:inchange'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:788:in exec_migration'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:772:inblock (2 levels) in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:771:in block in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:inwith_connection'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:770:in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:950:inmigrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1211:in block in execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1279:inblock in ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in block in transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/transaction.rb:189:inwithin_new_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/transactions.rb:211:intransaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1279:in ddl_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1210:inexecute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1183:in block in migrate_without_lock'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1182:ineach'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1182:in migrate_without_lock'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1133:inmigrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:1005:in up'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/migration.rb:983:inmigrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/tasks/database_tasks.rb:161:in migrate'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/activerecord-5.0.0/lib/active_record/railties/databases.rake:58:inblock (2 levels) in '
/usr/local/rvm/gems/ruby-2.3.0#saasapp/gems/rake-12.0.0/exe/rake:27:in <top (required)>'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/bin/ruby_executable_hooks:15:ineval'
/usr/local/rvm/gems/ruby-2.3.0#saasapp/bin/ruby_executable_hooks:15:in `'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
In addition to my comment suggesting you use rake db:migrate instead of rake db:migration:
I also suggest you look into rake db:rollback if you find you've made a mistake while generating your model/migration.
I believe you've used migration instead of migrate
rake db:migrate
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
I have a trivial Rails migration that is failing when I run rake db:migrate. This is in a development environment using SQLite3. This is the migration:
class RemoveMobileUserIdFromDevices < ActiveRecord::Migration
def up
remove_column :devices, :mobile_user_id
end
def down
add_column :devices, :mobile_user_id, :integer
end
end
I am experiencing the following error when running rake db:migrate:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
== RemoveMobileUserIdFromDevices: migrating ==================================
-- remove_column(:devices, :mobile_user_id)
rake aborted!
An error has occurred, this and all later migrations canceled:
incompatible character encodings: ASCII-8BIT and UTF-8
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:516:in `*'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:516:in `block in copy_table_contents'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/result.rb:20:in `block in each'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/result.rb:20:in `each'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/result.rb:20:in `each'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:514:in `copy_table_contents'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:478:in `copy_table'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:455:in `move_table'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:448:in `block in alter_table'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:447:in `alter_table'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:387:in `block in remove_column'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:386:in `each'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/sqlite_adapter.rb:386:in `remove_column'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:447:in `block in method_missing'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:422:in `block in say_with_time'
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:422:in `say_with_time'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:442:in `method_missing'
/Users/username/[removed]/[removed]/db/migrate/20120127204256_remove_mobile_user_id_from_devices.rb:3:in `up'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:394:in `block (2 levels) in migrate'
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:394:in `block in migrate'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in `with_connection'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:375:in `migrate'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:507:in `migrate'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:687:in `block (2 levels) in migrate'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:742:in `call'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:742:in `block in ddl_transaction'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/transactions.rb:208:in `transaction'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:742:in `ddl_transaction'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:686:in `block in migrate'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:671:in `each'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:671:in `migrate'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:549:in `up'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/migration.rb:530:in `migrate'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:161:in `block (2 levels) in <top (required)>'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/username/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/username/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `load'
/Users/username/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate
I'm not sure what the issue could be, as I have previous migrations with similar commands that have executed without issue. So far, I have tried typing the migration file by hand in TextMate (under the presumption that the actual file may have had a bad character encoding). I have also deleted the migration and recreated it via rails g migration RemoveMobileUserIdFromDevices mobile_user_id:integer but have seen no change.