Skip to content

getsentry/sentry-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 22, 2016
8886b7c · Feb 22, 2016
Jan 21, 2016
Dec 21, 2015
Feb 10, 2016
Feb 22, 2016
Feb 16, 2016
Jul 16, 2015
Jul 16, 2015
Apr 10, 2012
Jan 16, 2016
Jan 16, 2016
Feb 10, 2016
Feb 14, 2015
Jun 28, 2015
Feb 1, 2016
Jan 6, 2016
Dec 8, 2015
Feb 22, 2016
Jan 16, 2016

Repository files navigation

Raven-Ruby

Gem Version Build Status

A client and integration layer for the Sentry error reporting API.

Requirements

We test on Ruby MRI 1.8.7/REE through Ruby 2.3 at the latest patchlevel/teeny version. JRuby support is experimental - check TravisCI to see if the build is passing or failing.

Getting Started

Install

gem "sentry-raven" #, :github => "getsentry/raven-ruby"

Set SENTRY_DSN

# Set your SENTRY_DSN environment variable.
export SENTRY_DSN=http://public:secret@example.com/project-id
# Or you can configure the client in the code (not recommended - keep your DSN secret!)
Raven.configure do |config|
  config.dsn = 'http://public:secret@example.com/project-id'
end

Call

If you use Rails, you're already done - no more configuration required! Check Integrations for more details on other gems Sentry integrates with automatically.

Otherwise, Raven supports two methods of capturing exceptions:

Raven.capture do
  # capture any exceptions which happen during execution of this block
  1 / 0
end

begin
  1 / 0
rescue ZeroDivisionError => exception
  Raven.capture_exception(exception)
end

More Information