Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict when using with ankane/strong_migration Gem #722

Closed
leduytung opened this issue Sep 18, 2020 · 1 comment
Closed

Conflict when using with ankane/strong_migration Gem #722

leduytung opened this issue Sep 18, 2020 · 1 comment
Labels

Comments

@leduytung
Copy link

leduytung commented Sep 18, 2020

Hi,
I having trouble when using the chewy Gem with the ankane/strong_migration Gem.
Both 2 gems rewrite the method migrate of Active Support, lead to an infinite loop in the migrate function when I run rake db:migrate
Here are the error messages:
.... /home/meowth/.rvm/gems/ruby-2.5.3/gems/chewy-5.1.0/lib/chewy/railtie.rb:32:inblock 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/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)
If anyone solved this issue, please help me.
Thanks!

@leduytung
Copy link
Author

As I know and ankane comment in strong_migration repository (ankane/strong_migrations#129)
the issue come from alias_method_chain.
The question is why Chewy using alias_method_chain for Rails version < 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment