Debugging Rails

0 views
Skip to first unread message

Fritz Trapper

unread,
Nov 6, 2010, 8:19:35 AM11/6/10
to rubyonra...@googlegroups.com
I frequently use script/server -u to debug my rails application.

Is there any trick to execute a breakpoint in case of exception at the
location, where the exception occured?

--
Posted via http://www.ruby-forum.com/.

radhames brito

unread,
Nov 6, 2010, 9:06:35 AM11/6/10
to rubyonra...@googlegroups.com
place debugger in the line where you want the execution to stop

Fritz Trapper

unread,
Nov 6, 2010, 1:41:18 PM11/6/10
to rubyonra...@googlegroups.com
Nice idea, but what, if you don't know, where the exception will be
thrown somwhere in a rails lib?

radhames brito

unread,
Nov 6, 2010, 9:02:47 PM11/6/10
to rubyonra...@googlegroups.com
if you want it to stop that far in you have to step into untill you get where you want, i know tedious but i dont know of any other way

Arzumy MD

unread,
Nov 6, 2010, 10:10:58 PM11/6/10
to Ruby on Rails: Talk
You could run your test directly with rdebug

rdebug /path/to/test
catch Exception
c

That should break on exception.

Cheers!
Arzumy

Fritz Trapper

unread,
Nov 7, 2010, 6:55:25 AM11/7/10
to rubyonra...@googlegroups.com
Very nice. Thanks!
Reply all
Reply to author
Forward
0 new messages