Rake: rake aborted! Don't know how to build task 'db:migrat' (See the list of available tasks with `rake --tasks`)
Rake doesn't know the task name — a typo, a missing Rakefile, or a gem/engine not loaded.
rake aborted! Don't know how to build task 'db:migrat'Don't know how to build task 'assets:precompile'rake aborted! Don't know how to build taskSee the list of available tasks with `rake --tasks`Rake::Task Don't know how to build task Meaning
List tasks (bin/rails -T / rake -T), check spelling and the environment (some tasks exist only in certain envs), run via bin/rails (Rails 5+) so the app loads, and make sure you're in the project directory containing the Rakefile.
Common causes
- Typo in task name
- Rakefile missing in the current directory
- Gem providing the task not in the Gemfile/group
- Task only defined for another environment
- Running
rakeoutsidebundle exec
⚡ Quick fix
bin/rails -T | grep migratecdinto the project and usebundle exec rake- Add the gem to the correct Gemfile group
Detailed fix by platform
Rails
bin/rails -T | grep -i db:
How to diagnose
- Name — Spelling?
- Directory — Has Rakefile?
- Gem — Loaded in this env?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ArgumentError: missing keyword / unknown keyword Ruby: ArgumentError: missing keyword: :name / unknown keyword: :nmae
- ArgumentError: wrong number of arguments (given 1, expected 2) Ruby: ArgumentError: wrong number of arguments (given 1, expected 2..3)
- Bundler could not find compatible versions for gem Bundler: Bundler could not find compatible versions for gem "activesupport": In Gemfile: rails (= 7.1.0) depends on activesupport (= 7.1.0)
Most viewed in Ruby / Rails
- ActiveRecord::PendingMigrationError Rails: ActiveRecord::PendingMigrationError — Migrations are pending. To resolve this issue, run: bin/rails db:migrate
- ActionController::InvalidAuthenticityToken Rails: ActionController::InvalidAuthenticityToken (Can't verify CSRF token authenticity)
- undefined method for nil Ruby: NoMethodError: undefined method `x' for nil (nil:NilClass)
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026