2014-06-12 21 views
1

我試圖捕獲一個特定的異常,然後手動將其記錄到errbit,然後向用戶顯示錯誤消息並重定向它們。未初始化的常量Airbrake

在我的模型下面的代碼,我可以在錯誤

# Causes uninitialized constant Issue::Airbrake 

我如何手動登錄一個錯誤errbit?我正在使用Airbrake寶石版本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 

回答

2

我不得不從我的Gemfile中的生產組中移動Airbrake寶石。

相關問題