【问题标题】:Bugsnag doesn't send notification in rails consoleBugsnag 不在 Rails 控制台中发送通知
【发布时间】:2017-02-24 02:49:03
【问题描述】:

我在 Rails 4 的开发/生产环境中设置了 Bugsnag。

我很想在 Rails 控制台中测试一下。

Bugsnag.notify('test test test')

配置如下。

  Bugsnag.configure do |config|
    config.api_key = ENV['BUGSNAG_SECRET']
    config.notify_release_stages = ["production", "development"]
  end

我错过了什么重要的东西吗?

【问题讨论】:

  • 注意:我对 bugsnag 一无所知,所以这完全是猜测......它真的在测试/开发环境中进行通知吗? (有些宝石只在产品中这样做)
  • 谢谢!我会检查文档!
  • Bugsnag 确实会在开发、生产和登台中产生错误。
  • 确保你已经在 gemfile 中安装了 bugsnag gem。
  • 您确定设置了 api_key 吗?输入 Bugsnag.api_key 会得到什么

标签: ruby-on-rails bugsnag


【解决方案1】:

首先,我要确认您已将 bugsnag gem 安装到您的 Gemfile 中: bundle add bugsnag

为了正确测试notify,我建议尝试这样的事情:

begin
  raise 'Something went wrong!'
rescue => exception
  Bugsnag.notify(exception)
end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-08
    • 1970-01-01
    • 2020-04-05
    • 1970-01-01
    • 1970-01-01
    • 2023-03-19
    • 2017-07-01
    • 2017-08-24
    相关资源
    最近更新 更多