Exception Notification Gem and Rails 3

后端 未结 17 2049
野趣味
野趣味 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:55

    Using Rails 3.0.3 this works for me:

    gem "exception_notification", :git => "https://github.com/sickill/exception_notification.git", :require => 'exception_notifier'
    

    :git part is imported because its a patched version to get around the 'undefined method controller_name error' and :require to require the right lib.

    Then in my production.rb environment file i only have this (from the manual)

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

    Seems like there are many different ways to get this to work, but this was my way.

    Cheers!

提交回复
热议问题