---
title: Ruby integration guide
description: Honeybadger monitors your Ruby applications for errors and exceptions so that you can fix them wicked fast.
url: https://docs.honeybadger.io/lib/ruby/integration-guides/ruby-exception-tracking/
---

**Typical installation time:** 3 minutes

Hi there! You’ve found Honeybadger’s guide to **Ruby exception and error tracking**. Once installed, Honeybadger will automatically report exceptions wherever they may happen:

* During a web request
* In a background job
* In a rake task
* When a process crashes (`at_exit`)

If you’re new to Honeybadger, read our [Getting Started guide](https://docs.honeybadger.io/lib/ruby/) to become familiar with our Ruby gem. For a refresher on working with exceptions in Ruby, check out the [Honeybadger guide to Ruby exceptions](https://www.exceptionalcreatures.com/guides/what-are-ruby-exceptions.html).

## Installation

The first step is to add the honeybadger gem to your Gemfile:

```ruby
gem 'honeybadger'
```

Tell bundler to install:

```bash
bundle install
```

Next, you'll set the API key for this project.

```bash
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.

Next, require the *honeybadger* gem **after** any other gems you’re using:

```ruby
# ...
require 'honeybadger'
```

Honeybadger will detect any supported 3rd-party gems you’re using such as Sidekiq, Rake, etc. and integrate with them automatically.

To notify Honeybadger of an exception you’ve rescued, use `Honeybadger.notify`:

```ruby
begin
  fail 'oops'
rescue => exception
  Honeybadger.notify(exception)
end
```

For additional ways to use `Honeybadger.notify`, check out the [Reporting errors](https://docs.honeybadger.io/lib/ruby/errors/reporting-errors/) chapter of our [Getting started guide](https://docs.honeybadger.io/lib/ruby/).

For Rack-based web applications, see the [Rack integration guide](https://docs.honeybadger.io/lib/ruby/integration-guides/rack-exception-tracking/) for instructions on how to automatically report exceptions in web requests.

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
