Exception Notification Gem and Rails 3

后端 未结 17 2069
野趣味
野趣味 2021-01-30 05:16

I\'m trying to get this up and running, but I see \"uninitialized constant ExceptionNotifier\" whenever I start my server.

http://github.com/rails/exception_notificatio

17条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 05:52

    It took a bit of work but I got Exception Notifier working with Rails 3.0.0:

    1- rails plugin install http://github.com/sickill/exception_notification.git

    (If you don't want to use this fork, just apply his patch manually to the original Rails plugin: it is only 3 lines.) It fixes the 'undefined method controller_name error'

    2- In application.rb:

    config.middleware.use "::ExceptionNotifier" , :email_prefix => "[Whatever] ",
                               :sender_address => %{"notifier" },
                               :exception_recipients => %w{whoever@example.com} 
    

    3- Apply Lawrence Pit's patch. (UPDATE: This link appears to be broken) It fixes the uninitialized constant ActiveRecord::RecordNotFound error as documented here.

    That's it.

提交回复
热议问题