How to list all Rails 3 rake tasks? rake -T seems incomplete

Ruby on-RailsRake

Ruby on-Rails Problem Overview


> Possible Duplicate:
> Why is rake db:migrate:reset not listed in rake -T?

Inside my Rails (3.1.3) application, I can run rake db:test:prepare. But when I run rake -T [db], that task (and many others I can use) does not show up.

How do I get a complete list of tasks, or why is it incomplete in the first place?

E.g. http://mindspill.net/computing/cross-platform-notes/ruby-on-rails/how-to-list-rake-tasks/ shows that the 'db:test:prepare' task got listed for an older Rails version when running rails -T.

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

I found at https://stackoverflow.com/questions/3951514/why-is-rake-dbmigratereset-not-listed-in-rake-t (thanks @Beerlington for the link) that rake -P lists all tasks, which is what I was looking for.

Solution 2 - Ruby on-Rails

Only tasks with descriptions set will appear in rake -T.

As for why not all tasks have descriptions.... that I don't know.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFelix RabeView Question on Stackoverflow
Solution 1 - Ruby on-RailsFelix RabeView Answer on Stackoverflow
Solution 2 - Ruby on-RailssevenseacatView Answer on Stackoverflow