Subject: Notifier v2 not working in a rake task
I am using Rails 2.3.5. Upgraded to v2 and notifier is failing in a rake task.
namespace :notify_fans do
task :run => :environment do
begin
rescue Exception => e
notify_hoptoad(e)
end
end end
In case of exception I am getting following error.
undefined local variable or method
consider_all_requests_local' for main:Object
/usr/local/lib/ruby/gems/1.8/gems/hoptoad_notifier-2.1.2/lib/hoptoad_notifier/catcher.rb:47:innotify_hoptoad'
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by thoughtbot on 08 Feb, 2010 04:18 PM
Hi,
The correct way to use the notifier outside of a controller is to call:
Can you try that and let us know how it goes?
Thanks,
-Joe
3 Posted by neerajdotname on 08 Feb, 2010 05:24 PM
That worked.
Support Staff 4 Posted by thoughtbot on 08 Feb, 2010 06:27 PM
Thanks - I'll mark this as resolved. Please let us know if you have any other trouble.