Rails->breakpointer->irb->debugger?

How do you step through your Rails code from irb? Can you drop
into the debugger, or do you have put in a zillion breakpoints?
Is there a way to add & delete breakpoints from irb,
or do you have to set them all before you request a page?

···

--
My name is dsb, and I'm at prairienet, which is an O-R-G.

I think you'll like ruby-breakpoint[1]. Just put 'breakpoint' anywhere in your
code, and at that point you'll drop to an irb session where you can inspect
variables, and basically do whatever you want.

If that's not what you want, try googling for tutorials on using the Ruby
debugger.

Regards,
Alex

1. http://ruby-breakpoint.rubyforge.org/

···

On Thursday 14 September 2006 06:55, Dan Bensen wrote:

How do you step through your Rails code from irb? Can you drop
into the debugger, or do you have put in a zillion breakpoints?
Is there a way to add & delete breakpoints from irb,
or do you have to set them all before you request a page?

Check out ruby-debug.

http://blog.nanorails.com/articles/2006/07/14/a-better-rails-debugger-ruby-debug

The docs are a little out of date -- you'll also need to call
Debugger.start before your debugger call.

···

On Thu, 14 Sep 2006 00:56:04 -0500, Dan Bensen wrote:

How do you step through your Rails code from irb? Can you drop into the
debugger, or do you have put in a zillion breakpoints? Is there a way to
add & delete breakpoints from irb, or do you have to set them all before
you request a page?

Geoff Davis wrote:

Check out ruby-debug.

Thanks, that sounds like what I'm looking for.

···

--
My name is dsb, and I'm at prairienet, which is an O-R-G.

I finally got around to trying this, I'd installed the gem some time ago.

I tried it on a ruby script which takes parameters, but it doesn't
seem to work, the usage seems to indicate that you can give parameters
after the script name but rdebug seems to parse and choke on them
itself.

$ rdebug myscript -b 10
ruby-debug 0.4.1
Usage: rdebug [options] <script.rb> <script.rb parameters>

Options:
    -s, --server Listen for remote connections
    -w, --wait Wait for a client connection,
implies -s option
    -n, --nostop Do not stop when a client
connects, implies -s option
    -c, --client Connect to remote debugger
    -h, --host HOST Host name used for remote debugging
    -p, --port PORT Port used for remote debugging
        --script FILE Name of the script file to run
        --cport PORT Port used for contol commands,
implies -s option

Common options:
        --help Show this message
    -v, --version Show version

invalid option: -b

···

On 9/14/06, Geoff Davis <geoff@phds.org> wrote:

On Thu, 14 Sep 2006 00:56:04 -0500, Dan Bensen wrote:

> How do you step through your Rails code from irb? Can you drop into the
> debugger, or do you have put in a zillion breakpoints? Is there a way to
> add & delete breakpoints from irb, or do you have to set them all before
> you request a page?

Check out ruby-debug.

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

$rdebug myscript -- -b 10

···

On 9/14/06, Rick DeNatale <rick.denatale@gmail.com> wrote:

On 9/14/06, Geoff Davis <geoff@phds.org> wrote:
> On Thu, 14 Sep 2006 00:56:04 -0500, Dan Bensen wrote:
>
> > How do you step through your Rails code from irb? Can you drop into
the
> > debugger, or do you have put in a zillion breakpoints? Is there a way
to
> > add & delete breakpoints from irb, or do you have to set them all
before
> > you request a page?
>
> Check out ruby-debug.

I finally got around to trying this, I'd installed the gem some time ago.

I tried it on a ruby script which takes parameters, but it doesn't
seem to work, the usage seems to indicate that you can give parameters
after the script name but rdebug seems to parse and choke on them
itself.

$ rdebug myscript -b 10
ruby-debug 0.4.1
Usage: rdebug [options] <script.rb> <script.rb parameters>

--
Kent
---

Muchos Arrigato, mon ami!

···

On 9/14/06, Kent Sibilev <ksruby@gmail.com> wrote:

On 9/14/06, Rick DeNatale <rick.denatale@gmail.com> wrote:

> $ rdebug myscript -b 10
> ruby-debug 0.4.1
> Usage: rdebug [options] <script.rb> <script.rb parameters>
>
$rdebug myscript -- -b 10

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/