Build Status Code Climate Coverage Status Inline docs

A gem for dumping a whole binding and restoring it later. After restoring you can use pry to perform delayed debugging.

WARNING this gem is not ready for production yet, please, use it only in development environment.


Add this line to your application's Gemfile:

gem 'binding_dumper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install binding_dumper


To dump a binding run

# => "a lot of strange output here, that's fine"

Ideally, you should persist an output somewhere (like in the database). Let's say we have a Rails model called DumpedBinding with data field:

StoredBinding.create(data: binding.dump)

Make your server to execute the code above (just put it to any controller's action), go to the console, and run:

b = Binding.load(

And enjoy!

Blog post about internal parts of the gem


  • Ruby >= 1.9.3 (see travis.yml for supported versions)


The simplest one is in the file examples/simple.rb.

A bit more complex example with Rails environment is in spec/dummy/app/controllers/users_controller.rb


Clone the repo, run bundle install.

To run all tests using current ruby version, run rspec or rake.

To run all tests with ALL supported ruby versions, run bin/multitest and follow the output.

To run dummy app, run bin/dummy_rails s (bin/dummy_rails c for console).


  1. Fork it ([my-github-username]/binding_dumper/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request