The Airbrake CLI installs the Airbrake Ruby notifier automatically in your Ruby project. To install the gem directly without using the CLI, please scroll down to the Installing manually section.
Install the CLI via Homebrew
brew install airbrake/airbrake-cli/airbrake
Authenticate via config command
Authenticate by setting your user-key with the config command:
require 'airbrake-ruby'
Airbrake.configure do |c|
c.project_id = <Your project ID>
c.project_key = '<Your project API KEY>'
end
Testing your installation
To test your installation, send a test error to Airbrake as shown in the example below. 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
Full documentation
For in depth examples and advanced configuration options like error filtering or custom parameters, please visit our official GitHub repo.
Installing with the CLI
The Airbrake CLI installs the Airbrake Ruby notifier automatically in your Ruby project. To install the gem directly without using the CLI, please scroll down to the Installing manually section.
Install the CLI via Homebrew
Authenticate via
config
commandAuthenticate by setting your
user-key
with theconfig
command:You can find your user key in your profile settings page.
Install command
Invoke the following to have the Airbrake CLI install the Airbrake notifier for your project:
You can find your project ID in your project's settings.
After this, you are set! Check out the Testing your installation section to send a test error to Airbrake.
Installing manually
Option 1: Bundler
Add the Airbrake Ruby gem to your Gemfile:
Option 2: Manual
Invoke the following command from your terminal:
Configuration
Just
require
the library and copy this configuration snippet into your Ruby project:(You can find your project ID and API key in your project's settings)
Testing your installation
To test your installation, send a test error to Airbrake as shown in the example below. Uncaught errors are automatically sent to Airbrake. Caught errors can be sent to Airbrake using the
notify
method:Full documentation
For in depth examples and advanced configuration options like error filtering or custom parameters, please visit our official GitHub repo.