Subject: Notifier v2 not working in a rake task

Original Post neerajdotname's Avatar

neerajdotname

05 Feb, 2010 06:42 PM via web

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'

  1. Support Staff 2 Posted by thoughtbot on 08 Feb, 2010 04:18 PM

    thoughtbot's Avatar

    Hi,

    The correct way to use the notifier outside of a controller is to call:

    HoptoadNotifier.notify(e)
    

    Can you try that and let us know how it goes?

    Thanks,
    -Joe

  2. 3 Posted by neerajdotname on 08 Feb, 2010 05:24 PM

    neerajdotname's Avatar

    That worked.

  3. Support Staff 4 Posted by thoughtbot on 08 Feb, 2010 06:27 PM

    thoughtbot's Avatar

    Thanks - I'll mark this as resolved. Please let us know if you have any other trouble.

Comments are currently closed for this discussion. You can start a new one.