【问题标题】:How to get Hoptoad or Airbrake Error Notification in Development Environment on Rails如何在 Rails 开发环境中获取 Hoptoad 或 Airbrake 错误通知
【发布时间】:2010-08-26 07:29:46
【问题描述】:
请任何人帮忙解决,如何在 Rails 开发环境中获取 hoptoad/airbrake 错误通知,
我已经正确配置了airbrake,甚至我也从airbrake收到了测试邮件,即通过运行rake hoptoad:test或rake airbrake:test
但除此之外,我什么也没得到,即错误、期望等。
请帮我解决这个问题。
谢谢
【问题讨论】:
标签:
ruby-on-rails
error-handling
ruby-on-rails-plugins
hoptoad
【解决方案1】:
我认为这里的答案应该是从您的配置中获取“开发”。在初始化程序中尝试以下行:
HoptoadNotifier.configuration.development_environments = ['cucumber', 'test']
或
Airbrake.configure do |config|
config.development_environments = %w(cucumber test)
end
【解决方案2】:
将以下内容添加到您的config/environments/development.rb:
config.action_controller.consider_all_requests_local = false
并通过您的非环回 IP(不是 http://localhost:3000/ 或 http://127.0.0.1:3000/)访问您的应用程序,例如http://192.168.1.3:3000/(在您的网络设置中查找正确的 IP)。