【问题标题】:Unintialized constant Airbrake未初始化的恒定空气制动
【发布时间】:2014-06-12 04:24:50
【问题描述】:

我正在尝试捕获特定异常,然后手动将其记录到 errbit,然后向用户显示错误消息并重定向它们。

在我的模型中使用下面的代码,我可以错误

# Causes uninitialized constant Issue::Airbrake

如何手动将错误记录到 errbit?我正在使用 Airbrake gem 4.0.0 版

class Issue < ActiveRecord::Base
  after_create :send_email

  def send_email
    begin
    raise StandardError
    rescue StandardError => e
      # Log error in errbit manually
      Airbrake.notify(e)  # Causes uninitialized constant Issue::Airbrake
    end
  end

【问题讨论】:

    标签: ruby-on-rails airbrake errbit


    【解决方案1】:

    我不得不将 Airbrake gem 从我的 Gemfile 中的生产组中移出。

    【讨论】:

      猜你喜欢
      • 2014-07-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-03
      • 1970-01-01
      相关资源
      最近更新 更多