{ "html": "
\n

Installation

\n

Raven Ruby comes as a gem and is straightforward to install. If you are\nusing Bundler just add this to your Gemfile:

\n
gem "sentry-raven"\n
\n
\n

For other means of installation see Installation.

\n
\n\n\n
\n

Configuration

\n

To use Raven Ruby all you need is your DSN. Like most Sentry libraries it\nwill honor the SENTRY_DSN environment variable. You can find it on\nthe project settings page under API Keys. You can either export it as\nenvironment variable or manually configure it with Raven.configure:

\n
Raven.configure do |config|\n  config.dsn = '___DSN___'\nend\n
\n
\n
\n\n\n
\n

Reporting Failures

\n

If you use Rails, Rake, Sidekiq, etc, you’re already done - no more\nconfiguration required! Check Integrations for more details on\nother gems Sentry integrates with automatically.

\n

Rack requires a little more setup: Rack (Sinatra etc.)

\n

Otherwise, Raven supports two methods of capturing exceptions:

\n
Raven.capture do\n  # capture any exceptions which happen during execution of this block\n  1 / 0\nend\n\nbegin\n  1 / 0\nrescue ZeroDivisionError => exception\n  Raven.capture_exception(exception)\nend\n
\n
\n
\n", "link": "https://docs.getsentry.com/clients/ruby/", "id": "ruby", "name": "Ruby" }