tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

Check for pending migrations doesn't work when rake is in an indirect dependency

Open alex-tan opened this issue 11 months ago • 1 comments

We just noticed that the functionality added in #1418 isn't working in our Rails app (which uses Rake).

The culprit appears to be this line

When running debugger:

(ruby) defined?(::Rake)
nil

However when rake is added to our Gemfile the check works.

Perhaps it would be better to execute the code without Rake?

alex-tan avatar Feb 07 '25 19:02 alex-tan

railties depends on rake and it should load Rake::Task when we call Rails.application.load_tasks.

I don't see how it's not defined for you, maybe above will help with debugging.

We are executing a Rake task so I think using Rake is the way to go.

KaanOzkan avatar Feb 10 '25 14:02 KaanOzkan