Trackets Build Status Code Climate

This is a notification gem for It catches all unhandled exceptions and sends them to the Trackets servers.


Add this line to your application's Gemfile:

gem 'trackets'

And then execute:

$ bundle


In order to setup Trackets for Ruby, you need to first find your API key. To do this simply open up your project on Trackets, go to settings and copy the API key.

$ rails g trackets:install YOUR_API_KEY
$ rake trackets:test # To send testing exception


If you wish to enable JavaScript error tracking, you can do so using a helper which this gem provides. Simply include the following snippet in your app/views/layout/application.html.erb in the <head> tag directly above your application JavaScript.

  <%= trackets_include_tag %>

  <!-- The rest of your JavaScript goes below -->

  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
  <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>


Can be found in config/initializers/trackets.rb

Trackets.setup do |config|
  config.public_api_key = "ebf6d706b29ca4e176012a3dc3b017a8" # Public API key used by JavaScript for your project
  config.private_api_key = "77773de2325364bcc1d955e7aa3e7e1f" # Private API key used for Ruby notifications
  config.async = true # [Default: false] Send notification in a separate thread (Uses Sucker Punch gem)


Here's a sample

require 'rack'
require 'trackets'

Trackets.setup do |config|
  config.private_api_key = "insert-valid-api-key"

app = do
  run lambda { |env| raise "Testing Error" }

use Trackets::Middleware::RackExceptionHandler
run app

Rake tasks

Currently there is only one rake task for testing the setup by sending an exception to Trackets. You can do this simply by invoking rake trackets:notify in your application after you've installed the gem.

$ rake trackets:notify MESSAGE="Custom message from Rake"


  1. Fork it ([my-github-username]/trackets/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request