Я создаю новые таблицы с помощью mysqlite и Ruby on Rails. Почему мой рейк прерывается и как я могу это исправить?
Обновил мою версию Ruby on Rails и запустил 'bundle install'. Понятия не имею, почему я получаю эти сообщения, но, похоже, они связаны с управлением версиями Ruby.
Модель ингредиента
class Ingredient < ActiveRecord::Base
attr_accessor :picture, :name, :price, :quantity
end
Таблица ингредиентов
class CreateIngredients < ActiveRecord::Migration[5.2]
def change
create_table :ingredients do |t|
t.string :name
t.decimal :price
t.integer :quantity
t.timestamps
end
end
end
Моя таблица не создана, и я получаю это сообщение об ошибке:
♥ rake db:migrate
== 20190702014335 CreateIngredients: migrating ================================
-- create_table(:ingredients)
-> 0.0031s
== 20190702014335 CreateIngredients: migrated (0.0033s) =======================
rake aborted!
ArgumentError: wrong number of arguments (given 2, expected 0..1)
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/inheritance.rb:50:in `new'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:987:in `load_migration'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:982:in `migration'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:977:in `disable_ddl_transaction'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1350:in `use_transaction?'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1297:in `rescue in execute_migration_in_transaction'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1286:in `execute_migration_in_transaction'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `each'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1212:in `migrate'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1036:in `up'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1011:in `migrate'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <main>'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/Users/steven/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:24:in `eval'
/Users/steven/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:24:in `<main>'
Caused by:
ArgumentError: wrong number of arguments (given 2, expected 0..1)
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/inheritance.rb:50:in `new'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:987:in `load_migration'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:982:in `migration'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:977:in `disable_ddl_transaction'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1350:in `use_transaction?'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1342:in `ddl_transaction'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `each'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1212:in `migrate'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1036:in `up'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/migration.rb:1011:in `migrate'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <main>'
/Users/steven/.rvm/gems/ruby-2.3.3/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/Users/steven/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:24:in `eval'
/Users/steven/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)