The Raygun4Ruby provider
This is the official provider for the Ruby ecosystem - it also has built-in support for Rails.
Why add Raygun to my Ruby app?
Ruby is a great, flexible language that allows you to write powerful applications, whether for the web with a framework or elsewhere. All software has bugs; a good developer recognizes this and the fact that the correct tools can help minimize their effect. Specifically, the effect on his or her users. Raygun lets your app automatically send all errors and exceptions that it generates, and places them on a dashboard, allowing you to easily diagnose and fix the issue.
This provider has first-class support for:
- Ruby 1.9 or greater
- Rails 3/4
It also includes a Resque failure backend, for notifying Raygun if its queue falls over.
It comes as a gem, so add this line to your application's Gemfile':
And then execute:
Or install it yourself using:
gem install raygun4ruby
rails g raygun:install your_api_key
You can then test the integration by running:
You will then see an ItWorksException in your Raygun dashboard.
Manual exception tracking
With vanilla Ruby, it's easy as:
require 'rubygems' require 'raygun4ruby' Raygun.setup do |config| config.api_key = "YOUR_RAYGUN_API_KEY" config.filter_parameters = [ :password, :card_number, :cvv ] # don't forget to filter out sensitive parameters config.enable_reporting = true # to send errors, false to not log end begin # your lovely code here rescue Exception => e Raygun.track_exception(e) end