Skip to content
This repository

Debugging toolbar for Rack applications implemented as middleware

branch: redis_updates

This branch is 1 commit ahead and 51 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time



Rack::Bug adds a diagnostics toolbar to Rack apps. When enabled, it injects a floating div allowing exploration of logging, database queries, template rendering times, etc.


  • Password-based security
  • IP-based security
  • Rack::Bug instrumentation/reporting is broken up into panels.
    • Panels in default configuration:
      • Rails Info
      • Timer
      • Request Variables
      • SQL
      • Active Record
      • Cache
      • Templates
      • Log
      • Memory
    • Other bundled panels:
      • Redis
      • Sphinx
    • The API for adding your own panels is simple and powerful

Rails quick start

script/plugin install git://

In config/environments/development.rb, add:

config.middleware.use "Rack::Bug",
  :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring"

Add the bookmarklet to your browser:

open http://RAILS_APP/__rack_bug__/bookmarklet.html

Using with non-Rails Rack apps

Nothing should prevent this from being possible. Please contribute docs if you do this. :-)

Configuring custom panels

Specify the set of panels you want, in the order you want them to appear:

require "rack/bug"

ActionController::Dispatcher.middleware.use Rack::Bug,
  :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
  :panel_classes => [

Running Rack::Bug in staging or production

We have have found that Rack::Bug is fast enough to run in production for specific troubleshooting efforts.


Add the middleware configuration to an initializer or the appropriate environment files, taking the rest of this section into consideration.


Restrict access to particular IP addresses:

require "ipaddr"

ActionController::Dispatcher.middleware.use "Rack::Bug"
  :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
  :ip_masks   => ["")]

Restrict access using a password:

ActionController::Dispatcher.middleware.use "Rack::Bug",
  :secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
  :password   => "yourpassword"


  • Maintained by Bryan Helmkamp
  • Contributions from Luke Melia, Joey Aghion, and more


Inspiration for Rack::Bug is primarily from the Django debug toolbar. Additional ideas from Rails footnotes, Rack's ShowException middleware, Oink, and Rack::Cache

Thanks to for supporting the development of Rack::Bug


For development, you'll need to install the following gems: rspec, rack-test, webrat, sinatra


See MIT-LICENSE.txt in this directory.

Something went wrong with that request. Please try again.