Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Airbrake for your Ruby application #1

Open
jerrysitu opened this issue Oct 10, 2017 · 0 comments
Open

Setup Airbrake for your Ruby application #1

jerrysitu opened this issue Oct 10, 2017 · 0 comments
Labels

Comments

@jerrysitu
Copy link

Installation

Option 1: Bundler

Add the Airbrake Ruby gem to your Gemfile:

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

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:
(Your project ID and project API key have been included)

require 'airbrake-ruby'

Airbrake.configure do |c|
  c.project_id = 159697
  c.project_key = '21bbf5cc8a88c8056e5d4e49af5274ec'
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant