Russell Quinn
2008-May-07 22:10 UTC
Calling a controller method with a rake task - plugin errors
I have a rake task to call a controller method:
-------------------------------------
require ''action_controller''
require ''action_controller/integration''
namespace :backup do
desc "Starts automated backup procedure for all databases"
task "do_auto" do
app = ActionController::Integration::Session.new;
app.get ''/database/backup_auto''
end
end
-------------------------------------
When I run it I get an error about not finding an act_as_xxx which is
defined in a custom plugin:
/!\ FAILSAFE /!\ Thu May 08 00:05:47 +0200 2008
Status: 500 Internal Server Error
undefined local variable or method `acts_as_xxxx'' for
ApplicationController:Class
It''s my first rake task and I can''t quite get my head around
the app
boot process. Why can''t it find the plugin in this case?
Thanks,
Russell.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Rails problems running rake and other tasks - undefined method `action_controller'
- FAILSAFE error when attempting custom POST - How do I fault find for this?
- FAILSAFE error with uploads
- Rails3: "rake test" task does not run tests.
- Upgrading rails to 2.3.2 - CookieOverflow issue
