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

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

Open
alex-tan opened this issue Feb 7, 2025 · 1 comment

Comments

@alex-tan
Copy link
Contributor

alex-tan commented Feb 7, 2025

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?

@KaanOzkan
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants