Introduction
In this chapter we're going to cover the basics of installing the honeybadger gem and how configuration works. For full instructions and best practices for your framework or platform, see the Integration guides.
Installing the Gem
The first step is to add the honeybadger gem to your Gemfile:
gem 'honeybadger'
Tell bundler to install:
bundle install
Next, you'll set the API key for this project.
bundle exec honeybadger install [Your project API key]
This will do three things:
- Generate a
honeybadger.yml
file. If you don't like config files, you can place your API key in the$HONEYBADGER_API_KEY
environment variable. - If Capistrano is installed, we'll add a require statement to Capfile.
- Send a test exception to your Honeybadger project.
How Configuration Works
Honeybadger's configuration consists of named options. Some are top level
options such as api_key
, while others have nested namespaces (separated with a
dot) such as exceptions.ignore
. The only required option is api_key
.
There are three ways to configure options for the Honeybadger gem:
- honeybadger.yml configuration file
- Environment variables
- Programmatically using
Honeybadger.configure
By default we use the honeybadger.yml file, so that's what most of the examples will use in this guide, but the method you use is a matter of preference. Here's an example honeybadger.yml file:
---
api_key: "Your project API key"
See the Configuration reference for additional info.