Sponsors

Debugging Rails

Posted by Darshan Patil Sat, 22 Sep 2007 19:40:00 GMT

script/breakpointer does not work anymore with the latest stable version of rails. The new way to debug rails applications is to use ruby-debug. To use this to debug your rails applications, do the following

gem install ruby-debug

Once, that is done, edit config/environments/development.rb in your rails application and add the following line to the end of the file.

require 'ruby-debug' 

To break into the debugger, you need to call

debugger()

where you would have previously called breakpoint(). When debugger() is executed, the server will break into the debugger. Run help to see a list of available commands. You can also launch an irb process by typing irb at the debugger prompt.

Note: Debugger does not work with fastcgi. It works with mongrel and webrick.

Trackbacks

Use the following link to trackback from your own site:
http://scattrbrain.com/articles/trackback/196

Comments

Leave a response

Comments