A Rack middleware that replaces standard Rails/Rack error pages with an interactive, feature-rich debugging interface.
Better Errors is a Ruby gem that replaces the standard, plain error pages in Rails and Rack applications with a powerful, interactive debugging page. It solves the problem of cryptic or unhelpful error messages by providing developers with a rich interface to inspect variables, view source code, and execute code in real-time when an exception occurs.
Ruby on Rails and Rack application developers working in development environments who need to quickly diagnose and fix errors during the coding process.
Developers choose Better Errors because it transforms passive error viewing into an active debugging session, offering features like a live REPL and variable inspection that are not available in default error pages, significantly reducing debugging time.
Better error page for Rack apps
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a live shell on every stack frame for real-time code execution, allowing developers to test fixes directly from the error page, as highlighted in the README's features list.
Enables examination of local and instance variables at each stack level, helping pinpoint data state at the moment of error, which is a core feature for debugging.
Includes direct links to open source code in your editor, speeding up navigation to problematic lines, though it requires setting the EDITOR environment variable.
Displays complete call stacks with highlighted source code for every frame, offering clear context beyond basic error messages.
Delivers useful error information for API and AJAX requests with non-HTML responses, as stated in the README, making it versatile for modern web apps.
With servers like Unicorn or Puma, it can lead to session expiration errors unless workers are reduced to one, complicating development setup and requiring configuration changes.
Advanced features like REPL and variable inspection require the optional binding_of_caller gem, adding dependency overhead and potential compatibility issues.
By default, only accessible from localhost, making it less useful for remote development setups without additional configuration, as warned in the security section.
Setting up editor links requires environment variables and may not work with certain editors or under Content Security Policies, needing manual workarounds like BETTER_ERRORS_INSIDE_FRAME.