How prevent rollbar from reporting errors in the development environment?

piton4eg picture piton4eg · Oct 29, 2013 · Viewed 9.7k times · Source

How I can disable the rollbar gem from reporting errors in my development environment? I want to get errors only from staging and production, but I didn't find it in docs on Rollbar's site.

Answer

piton4eg picture piton4eg · Oct 30, 2013

Put this code into initializers/rollbar.rb:

Rollbar.configure do |config|
  # ...

  unless Rails.env.production?
    config.enabled = false
  end

  # ...
end