SimonMiaou/dritorjan

Setup Airbrake for your Ruby application

Closed this issue · 0 comments

Installation

Option 1: Bundler

Add the Airbrake Ruby gem to your Gemfile:

gem 'airbrake-ruby', '~> 2.5'

Option 2: Manual

Invoke the following command from your terminal:

gem install airbrake-ruby

Configuration

Just require the library and copy this configuration snippet into your Ruby project:
(You can find your project ID and API key with your project's settings)

require 'airbrake-ruby'

Airbrake.configure do |c|
  c.project_id = <Your project ID>
  c.project_key = '<Your project API KEY>'
end

Uncaught errors are automatically sent to Airbrake. Caught errors can be sent to Airbrake using the notify method:

begin
  1/0
rescue ZeroDivisionError => ex
  Airbrake.notify(ex)
end

Configuration

For in depth examples and advanced configuration options like error filtering or custom parameters, please visit our official GitHub repo.