You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like require_dependency is biting us against. This time it fails with Rails 6.
$ consistency_failTraceback (most recent call last): 8: from /Users/user/.rbenv/versions/2.6.1/bin/consistency_fail:23:in `<main>' 7: from /Users/user/.rbenv/versions/2.6.1/bin/consistency_fail:23:in `load' 6: from /Users/user/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/consistency_fail-0.3.7/bin/consistency_fail:20:in `<top (required)>' 5: from /Users/user/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/consistency_fail-0.3.7/lib/consistency_fail.rb:11:in `run' 4: from /Users/user/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/consistency_fail-0.3.7/lib/consistency_fail/models.rb:19:in `preload_all' 3: from /Users/user/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/consistency_fail-0.3.7/lib/consistency_fail/models.rb:19:in `each' 2: from /Users/user/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/consistency_fail-0.3.7/lib/consistency_fail/models.rb:21:in `block in preload_all' 1: from /Users/user/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/consistency_fail-0.3.7/lib/consistency_fail/models.rb:21:in `each'/Users/user/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/consistency_fail-0.3.7/lib/consistency_fail/models.rb:22:in `block (2 levels) in preload_all': private method `require_dependency' called for Kernel:Module (NoMethodError)Did you mean? require_relative
Finally, you should pay attention to Xavier Noria’s new Zeitwerk code loader for Ruby. It didn’t make the integration cut for beta1, but starting with beta2, it’ll be the new autoloader for Rails. Be prepared to say goodbye to any lingering require or require_dependency calls in your code!
Not sure if Rails 6 switching to Zeitwerk is relevant to solving the use of require_dependency in consistency_fail.
The text was updated successfully, but these errors were encountered:
alphabt
changed the title
Incompatible with Rails 6
Incompatible with Rails 6, private method `require_dependency' called for Kernel:Module
May 13, 2019
Changing behavior with a version check should be ok. But I'm not sure if require will work since we tried that last time and it caused a regression with enum per #47.
I haven't done much research into what to use for Rails 6 yet. If I do find something I'll definitely share it here.
Ah, yeah I guess I was making an assumption there based on the "eliminates all known use cases for require_dependency, including STIs" language in this Zeitwerk blog post - but on re-reading I think it might be more complicated, since the advice on the Rails announcement is about dropping the need for both require and require_dependency...
Looks like
require_dependency
is biting us against. This time it fails with Rails 6.Gemfile
According to https://weblog.rubyonrails.org/2019/1/18/Rails-6-0-Action-Mailbox-Action-Text-Multiple-DBs-Parallel-Testing/
Not sure if Rails 6 switching to Zeitwerk is relevant to solving the use of
require_dependency
in consistency_fail.The text was updated successfully, but these errors were encountered: