A client and integration layer for the Sentry error reporting API.
We test on Ruby 1.9, 2.2 and 2.3 at the latest patchlevel/teeny version. JRuby support is experimental - check TravisCI to see if the build is passing or failing.
gem "sentry-raven" #, :github => "getsentry/raven-ruby"
# 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
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
- Documentation
- Bug Tracker
- Code
- Mailing List
- IRC (irc.freenode.net, #sentry)