将ankane/strong_migration
gem 与toptal/chewy gem
.
两个 gem 都重写了 Active Support 的方法 migrate,导致我运行时 migrate 函数中的无限循环rake db:migrate
以下是错误消息:
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/strategy.rb:70:in `wrap`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy.rb:201:in `strategy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/railtie.rb:32:in `migrate_with_chewy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/strong_migrations-0.3.1/lib/strong_migrations/migration.rb:13:in `migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/railtie.rb:32:in `block in migrate_with_chewy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/strategy.rb:70:in `wrap`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy.rb:201:in `strategy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/railtie.rb:32:in `migrate_with_chewy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/strong_migrations-0.3.1/lib/strong_migrations/migration.rb:13:in `migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/railtie.rb:32:in `block in migrate_with_chewy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/strategy.rb:70:in `wrap`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy.rb:201:in `strategy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/railtie.rb:32:in `migrate_with_chewy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/strong_migrations-0.3.1/lib/strong_migrations/migration.rb:13:in `migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:768:in `migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:1023:in `block in execute_migration_in_transaction`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:1069:in `block in ddl_transaction`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/transactions.rb:220:in `transaction`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:1069:in `ddl_transaction`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:1022:in `execute_migration_in_transaction`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:984:in `block in migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:980:in `each`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:980:in `migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/railtie.rb:32:in `block in migrate_with_chewy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/strategy.rb:70:in `wrap`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy.rb:201:in `strategy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/railtie.rb:32:in `migrate_with_chewy`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:823:in `up`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:801:in `migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:139:in `migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/strong_migrations-0.3.1/lib/strong_migrations/database_tasks.rb:4:in `migrate`
/home/meowth/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>`
/home/meowth/.rvm/gems/ruby-2.5.3/bin/bundle:23:in `load`
/home/meowth/.rvm/gems/ruby-2.5.3/bin/bundle:23:in `<main>` Tasks: TOP
=> db:migrate (See full trace by running task with --trace)
如果有人解决了这个问题,请帮助我。谢谢!