My rake task is not showing up in rake -T

I had this problem, but it was due to the fact that I hadn't provided a description for my task. Once I added desc 'Hello World' above my task block, the task showed up in the list.


It could be that you've given the task the .rb extension instead of .rake


If you want a really complete list of all rake tasks, you need to run rake -T -A.


My solution was that I had the incorrect directory. I created custom tasks under Rails.root/app/lib/tasks when it should have been Rails.root/lib/tasks.

Only realized this after running the command bin/rails generate task as per the Rails guides.