ruby - Rails calling a task in lib/tasks folder -


i have backup.rake file in lib/tasks folder

task looks this:

require 'find' namespace :backup     desc "backup database file."    task :mysqldump => [:environment]   end end 

now want call controller this:

system "rails_env="+rails.env+"rake backup:mysqldump" 

but got error:

sh: 1: backup:mysqldump: not found 

what problem? same other tasks ...

it should this

system "rails_env="+rails.env+" rake backup:mysqldump" 

a space between " rake


Comments