When you put a Rake task into lib/tasks, but running it fails with...
lib/tasks
Don't know how to build task name:of:task
Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)
... does your Rake task's filename end in .rb? It needs to end in .rake instead.
.rb
.rake