I’ve got a few custom rake tasks and all work find in development. I
recently wrote a rake task that I intend to run periodically in a cron
on the server to perform certain maintenance tasks. The new rake task
works fine on my development machine. Running ‘rake -tasks’ on the dev
machine shows the task right there in the list. When I deploy the app
to the server (using capistrano) I can see the .rake file right there
in lib/tasks where it’s supposed to be. Permissions and ownership are
all correct. So far so good.
However, when I actually try to run the task on the server (right from
the command line, not in CRON yet), Rake just responds that it doesn’t
know how to build the task. When I run ‘rake --tasks’ on the server,
my new task doesn’t show in the list. In fact, the only one of my
custom tasks that show in the --tasks list is one that capistrano runs
directly after deploy… which works.
All the built-in rake tasks like db:migrate, etc show up in the –
tasks list and work when run. The custom task that capistrano runs
also runs fine from the command line.
So, anybody got any ideas? I’ve blown a perfectly good Sunday
afternoon beating my head against the wall over this and getting