Better Errors Gem: Debugging Rails apps with the browser
Since a long time the browser is not just an interface to surf the web.
Posted in Ruby
January 21, 2013 - 1 min read
In my particular case, when I'm programming application based on Ruby on Rails, the browser doesn't offer me too much information when an error happens. That's where Better Errors comes to the rescue.
What is Better Errors?
Better Errors is a gem developed by Charlie Somerville, and it purpose its to replace the classic built-in error page provided by Rails for something more interactive and usable, and adds some cool functionality like:
- Full stack trace
- Source code inspection for all stack frames (with hightlighting)
- Local and instance variable inspection
- Live REPL on every stack frame
How do I integrate Better Errors on my Rails app?
That's easty. Just add it to your
Gemfile, like this:
group :development dogem "better_errors"end
And the best part is works with any Rack app, not just Rails.