pry is a pretty and pretty good ruby console.
It can be used as a empowered
irb, with TAB completion, code highlight and so on.
But its real use is to inspect execution of ruby code.
#!/usr/bin/env ruby # foo.rb require "pry" class Foo def bar x,y binding.pry # block execution and start a pry console here end end Foo.new.bar 1,2
% pry foo.rb From: (pry) @ line 6 Foo#bar: 5: def bar x,y => 6: binding.pry # block execution and start a pry console here 7: end  pry(#<Foo>)> ls Foo#methods: bar locals: _ __ _dir_ _ex_ _file_ _in_ _out_ _pry_ x y  pry(#<Foo>)> p x,y 1 2  pry(#<Foo>)>
pry-remote provides a solution:
binding.pry_remoteto block execution and listen on
- a CLI client
pry-remote, which connects to
127.0.0.1:9876and start pry
lets you start
rails console with pry.
The only work is adding
gem "pry-rails" to
pry-debugger adds debug instructions to pry:
NOT compatible with ruby 2.1 yet.