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 #2

Open
cinderrouge opened this issue Nov 7, 2018 · 0 comments
Open

Setup Airbrake for your Ruby application #2

cinderrouge opened this issue Nov 7, 2018 · 0 comments
Labels

Comments

@cinderrouge
Copy link
Owner

Installation

Option 1: Bundler

Add the Airbrake Ruby gem to your Gemfile:

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

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.

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