为异常通知添加 slack gem

Add slack to exception-notification gem

我有一个 Rails 3.2.8 应用程序使用 Ruby 1.9.3。我正在尝试配置松弛集成以使用 execption_notification。 execption_notification 适用于邮件,但在根据此处的自述文件添加松弛集成后,我在尝试启动服务器时收到此错误...

exception_notifier.rb:102:in `rescue in create_and_register_notifier': No notifier named 'slack' was found. Please, revise your configuration options. Cause: uninitialized constant ExceptionNotifier::SlackNotifier (ExceptionNotifier::UndefinedNotifierError)

这是我的 config/env/production.rb

中的相关行
#email notifications for exception in app
  MyApp::Application.config.middleware.use ExceptionNotification::Rack,
    :email => {
      :email_prefix => "[Exception] ",
      :sender_address => %{"notifier" <notifier@example.com>},
      :exception_recipients => %w{email},
    },
    :slack => {
      :webhook_url => "[mySlackHook",
      :channel => "#exceptions",
      :additional_parameters => {
        :icon_url => "error.png"
      }
    } 

RubyGems (https://rubygems.org/gems/exception_notification)

exception_notification gem 的当前版本中尚未添加 Slack 集成

尝试使用 git 回购版本:

在您的 Gemfile 中:

gem 'exception_notifications', git: 'https://github.com/smartinez87/exception_notification.git'

或在您的 Gemfile 中指定“4.1.0rc1”版本