Skip to content

Instantly share code, notes, and snippets.

@virtuexru
Last active August 29, 2015 14:15
Show Gist options
  • Save virtuexru/ab7176478f031797093b to your computer and use it in GitHub Desktop.
Save virtuexru/ab7176478f031797093b to your computer and use it in GitHub Desktop.
binding.pry quick tips

server start

** note: can be done on any ruby/rails script/server

rescue rails s

introspection

(like live .inspect) for classes

ls object

shows documentation

prereq: rvm docs generate

show-doc File.write

if in exception run-time

show stack trace

show-stack

move around the stack x frames

up 1 down 1

track down the root cause of the error

cd-cause

edit the file where the exception was raised

**note: will use bash default set editor

edit -e

try it again

try-again

run a line from within binding.pry

happens on runtime [323 = line #]

play -l 323

next line

n

step

step

break

continue

replace context

whereami

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment