# Having trouble using ruby-debug

**URL:** <https://www.ruby-forum.com/t/having-trouble-using-ruby-debug/165123>\
**Category:** Ruby\
**Created:** [April 9, 2009, 10:51am UTC](https://www.ruby-forum.com/t/having-trouble-using-ruby-debug/165123 "2009-04-09T10:51:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Quadling](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@Richard\_Quadling](https://www.ruby-forum.com/u/Richard_Quadling)\
**Post date:** [April 9, 2009, 10:51am UTC](https://www.ruby-forum.com/t/having-trouble-using-ruby-debug/165123/1 "2009-04-09T10:51:35Z")

</div>

Hi.

I’m on Windows.

I want to debug a rake process.

The rake works, but there is a bug in one of the processes involved in  
the rake.

I’m gem install ruby-debug and that all looked OK.

I type rake -rdebug to get things going.

This is what I see:

==================================  
[09/04/2009 9:43:23] [D:] [] \>rake -rdebug  
Debug.rb  
Emacs support available.

# C:/Ruby/lib/ruby/1.8/optparse.rb:1292: (rdb:1)

So far so good.

If I now enter the command list :

# ================================== (rdb:1) list [1287, 1296] in C:/Ruby/lib/ruby/1.8/optparse.rb No sourcefile available for C:/Ruby/lib/ruby/1.8/optparse.rb (rdb:1)

which doesn’t really make much sense to me. OK, I’m not really  
interested in the code in optparse.rb. This was just my first attempt  
to see what is going on.

The code between lines 1287 and 1296 of C:\Ruby\lib\ruby\1.8\optparse.rb  
is …

# ================================== begin opt, cb, val = sw.parse(val, argv) {|\*exc| raise(_exc) if eq} raise InvalidOption, arg if has\_arg and !eq and arg == “-#{opt}” argv.unshift(opt) if opt and (opt = opt.sub(/\A-_/, ‘-’)) != ‘-’ val = cb.call(val) if cb setter.call(sw.switch\_name, val) if setter rescue ParseError raise $!.set\_option(arg, arg.length \> 2) end

So, the code DOES exist. Like I said earlier, the issue is within one  
of the processes within the rake, not rake or ruby itself.

Any help would appreciated.

I’m a newbie here, so please be nice.

Regards,

Richard Quadling.

---

<div class="post-metadata">

**Author:** ![Richard\_Quadling](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@Richard\_Quadling](https://www.ruby-forum.com/u/Richard_Quadling)\
**Post date:** [April 10, 2009, 8:37pm UTC](https://www.ruby-forum.com/t/having-trouble-using-ruby-debug/165123/2 "2009-04-10T20:37:15Z")

</div>

Richard Quadling wrote:

> Hi.
> 
> I’m on Windows.
> 
> I want to debug a rake process.

Can you reproduce it somehow easily [and post an easy to reproduce  
version]?  
May want to report it to ruby-debug people.  
Cheers

---

<div class="post-metadata">

**Author:** ![Richard\_Quadling](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@Richard\_Quadling](https://www.ruby-forum.com/u/Richard_Quadling)\
**Post date:** [April 11, 2009, 6:39am UTC](https://www.ruby-forum.com/t/having-trouble-using-ruby-debug/165123/3 "2009-04-11T06:39:43Z")

</div>

On Thu, Apr 9, 2009 at 4:48 AM, Richard Quadling  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I type rake -rdebug to get things going.

Just FYI, -rdebug option doesn’t activate ruby-debug, but instead it  
makes you use the standard debugger that comes with every Ruby  
installation.
