Check out the Patches to Ruby 2.x and 1.9 to support beautiful debugging project to see if there is already a package made for your OS.
Many people use rvm to allow multiple versions of Ruby and gems to coexist.
If you have rvm installed and want to try several steps in one shot, then run:
$ bash <<( curl http://ruby-19-debugger.googlecode.com/git/patches/scripts/rvm-install-tf) $ rvm use ruby-1.9.3-p374-ndebugger $ gem install trepanning
If you want ansi-terminal colorized source code output, also install
$ trepan irb -- (/usr/local/bin/irb:9) require “irb” (trepan): # try: “help” or “quit” or EOF to leave
Wasn’t that easy?