I have defined a rake task as follows in a file called file_locker_task.rake
namespace :myspace do
task :process => :environment do
FileLocker.lock_files
end
end
How do I execute this rake task from the command line? I tried:
rake myspace:process
and rake process
but both are throwing an error like this:
rake aborted!
Don't know how to build task 'process'
rake -T -A
from your Rails home directory to see all the tasks that rake knows about. Yours must be in that list for rake to run it.lib/tasks
directory and its subdirectories for your .rake
files. Check that. (I suspect this is the problem.)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With