Rails 3 GEM to handling where the error has occurred

It’s Better Errors GEM. It will handle the error and we can see exactly where the error has occurred in development machine.

GITHUB : https://github.com/charliesome/better_errors

Steps to configure in our rails3 application

1.  Install the  gem install airbrake -v ‘3.1.8’

2. In your Gemfile add

group :development do
  gem "better_errors"
end

If you would like to use Better Errors’ advanced features you need to add the binding_of_caller

group :development do
  gem "better_errors"
  gem "binding_of_caller"
end

3. Add in below line at the end config/environments/development.rb
   BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']

4. Thats it!
   TRUSTED_IP=127.0.0.1 rails s

Permanent link to this article: https://blog.openshell.in/2014/03/rails-3-better-errors-gem-handling-where-the-error-has-occurred/

Leave a Reply

Your email address will not be published.