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:

  1. 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.
  2. If Capistrano is installed, we'll add a require statement to Capfile.
  3. 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:

  1. honeybadger.yml configuration file
  2. Environment variables
  3. 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.