Pry – An IRb Alternative

Posted on

Pry is an excellent alternative to IRb with syntax highlighting and proper indentation.

You can install pry by simply running the command

gem install pry

And then on the command line, run it!

> pry

But the best thing about pry is that it brings an REPL (read-eval-print-loop) session directly to your code! Just do the following.

require 'pry'
# Code above
#Code below

and it will display the session at the point where you’ve placed the method. You can play around with your code and then exit with the command exit.

For more details, check out
* Pry Home

Leave a Reply

Your email address will not be published.