Ruby-Debug uses rdebug (instead of irb) as the debugger when you run a Ruby on Rails app.
This means that you can see the code around your breakpoint, and examine variables more easily.
Ruby-debug Home Page
an (outdated) example
(These steps were tested using Ruby 1.8.6 and Rails 1.2.3. They should work for earlier versions as well, unless ruby-debug specifically says ‘Nope!’. The install and usage will probably be different once Rails 2.0 comes out.)
gem install ruby-debug
require 'ruby-debug'
script/server
script/server --debugger or ruby script/server --debugger for Windows people)debugger to the lines where you want to inspect your code (use just like breakpoint)help will allow you to see a list of commands: help command will give you more detail on each one.p insert_variable_name_here to print it. Also typing “set autoeval” makes everything you type print out.irb to drop into an interactive ruby console (equivalent to irb or script/console). Now you can really have fun!- Adam G.
Ruby-Debug uses rdebug (instead of irb) as the debugger when you run a Ruby on Rails app.
This means that you can see the code around your breakpoint, and examine variables more easily.
Ruby-debug Home Page
an (outdated) example
(These steps were tested using Ruby 1.8.6 and Rails 1.2.3. They should work for earlier versions as well, unless ruby-debug specifically says ‘Nope!’. The install and usage will probably be different once Rails 2.0 comes out.)
gem install ruby-debug
require 'ruby-debug'
script/server
script/server --debugger or ruby script/server --debugger for Windows people)debugger to the lines where you want to inspect your code (use just like breakpoint)help will allow you to see a list of commands: help command will give you more detail on each one.p insert_variable_name_here to print it. Also typing “set autoeval” makes everything you type print out.irb to drop into an interactive ruby console (equivalent to irb or script/console). Now you can really have fun!- Adam G.