Installing Airbrake in a Rails Application.

Rails Installation

Rails 4.x & 3.x

Add the airbrake gem to your Gemfile. In Gemfile:

gem 'airbrake'

In your project's root, run:

bundle install
rails generate airbrake --api-key your_project_key_here

The generator creates a file under config/initializers/airbrake.rb configuring Airbrake with your API key. This file should be checked into your version control system so that it is deployed to your staging and production environments.

Here is an asciicast of this process.

Rails 2.x

Add the airbrake gem to your app. In config/environment.rb:

config.gem 'airbrake'
or if you are using bundler:
gem 'airbrake', :require => 'airbrake/rails'
Then from your project's RAILS_ROOT, and in your development environment, run:
rake gems:install
rake gems:unpack GEM=airbrake
script/generate airbrake --api-key your_key_here
As always, if you choose not to vendor the airbrake gem, make sure every server you deploy to has the gem installed or your application won't start.

The generator creates a file under config/initializers/airbrake.rb configuring Airbrake with your API key. This file should be checked into your version control system so that it is deployed to your staging and production environments.

Errors from development, test, cucumber envs

Exceptions raised from Rails environments named development, test or cucumber will be ignored by default.

You can clear the list of ignored environments with this setting:

config.development_environments = []

if you want to report 500 Errors from these environments you will need to change the consider_all_reqeusts_local from true to false in config/environments/development.rb:

config.consider_all_requests_local = false 
// Shows prod style errors

Errors Ignored by default

Airbrake will not report errors with the following classes by default

ActiveRecord::RecordNotFound
ActionController::RoutingError
ActionController::InvalidAuthenticityToken
CGI::Session::CookieStore::TamperedWithCookie
ActionController::UnknownHttpMethod
ActionController::UnknownAction
AbstractController::ActionNotFound
Mongoid::Errors::DocumentNotFound
You can allow errors from all classes to be sent with the following config line
Note: This may cause you to hit your max errors per minute limit
config.ignore_only = []

More Info and Customizations in the Airbrake github wiki

Please visit https://github.com/airbrake/airbrake/wiki for more config customizations and special use cases.