# Ruby - Debugging

**URL:** <https://rubytalk.org/t/ruby-debugging/37820>\
**Category:** ruby-talk\
**Created:** [24 May 2007 19:23 UTC](https://rubytalk.org/t/ruby-debugging/37820 "2007-05-24T19:23:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![How\_do\_I\_use\_the\_rub](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@How\_do\_I\_use\_the\_rub](https://rubytalk.org/u/How_do_I_use_the_rub)\
**Post date:** [24 May 2007 19:23 UTC](https://rubytalk.org/t/ruby-debugging/37820/1 "2007-05-24T19:23:47Z")

</div>

How do I use the ruby default debugger?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Tomas\_Pospisek](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@Tomas\_Pospisek](https://rubytalk.org/u/Tomas_Pospisek)\
**Post date:** [24 May 2007 19:44 UTC](https://rubytalk.org/t/ruby-debugging/37820/2 "2007-05-24T19:44:53Z")

</div>

$ ruby -rdebug /tmp/some\_ruby\_program.rb  
Debug.rb  
Emacs support available.

/tmp/k.rb:1:puts "a"  
(rdb:1) help  
Debugger help v.-0.002b  
Commands  
&nbsp;&nbsp;&nbsp;b[reak] [file:|class:]\<line|method\>  
&nbsp;&nbsp;&nbsp;b[reak] [class.]\<line|method\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set breakpoint to some position  
&nbsp;&nbsp;&nbsp;wat[ch] \<expression\> set watchpoint to some expression  
&nbsp;&nbsp;&nbsp;cat[ch] (\<exception\>|off) set catchpoint to an exception  
&nbsp;&nbsp;&nbsp;b[reak] list breakpoints  
&nbsp;&nbsp;&nbsp;cat[ch] show catchpoint  
&nbsp;&nbsp;&nbsp;del[ete][nnn] delete some or all breakpoints  
&nbsp;&nbsp;&nbsp;disp[lay] \<expression\> add expression into display expression list  
&nbsp;&nbsp;&nbsp;undisp[lay][nnn] delete one particular or all display expressions  
&nbsp;&nbsp;&nbsp;c[ont] run until program ends or hit breakpoint  
&nbsp;&nbsp;&nbsp;s[tep][nnn] step (into methods) one line or till line nnn  
&nbsp;&nbsp;&nbsp;n[ext][nnn] go over one line or till line nnn  
&nbsp;&nbsp;&nbsp;w[here] display frames  
&nbsp;&nbsp;&nbsp;f[rame] alias for where  
&nbsp;&nbsp;&nbsp;l[ist][(-|nn-mm)] list program, - lists backwards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nn-mm lists given lines  
&nbsp;&nbsp;&nbsp;up[nn] move to higher frame  
&nbsp;&nbsp;&nbsp;down[nn] move to lower frame  
&nbsp;&nbsp;&nbsp;fin[ish] return to outer frame  
&nbsp;&nbsp;&nbsp;tr[ace] (on|off) set trace mode of current thread  
&nbsp;&nbsp;&nbsp;tr[ace] (on|off) all set trace mode of all threads  
&nbsp;&nbsp;&nbsp;q[uit] exit from debugger  
&nbsp;&nbsp;&nbsp;v[ar] g[lobal] show global variables  
&nbsp;&nbsp;&nbsp;v[ar] l[ocal] show local variables  
&nbsp;&nbsp;&nbsp;v[ar] i[nstance] \<object\> show instance variables of object  
&nbsp;&nbsp;&nbsp;v[ar] c[onst] \<object\> show constants of object  
&nbsp;&nbsp;&nbsp;m[ethod] i[nstance] \<obj\> show methods of object  
&nbsp;&nbsp;&nbsp;m[ethod] \<class|module\> show instance methods of class or module  
&nbsp;&nbsp;&nbsp;th[read] l[ist] list all threads  
&nbsp;&nbsp;&nbsp;th[read] c[ur[rent]] show current thread  
&nbsp;&nbsp;&nbsp;th[read] [sw[itch]] \<nnn\> switch thread context to nnn  
&nbsp;&nbsp;&nbsp;th[read] stop \<nnn\> stop thread nnn  
&nbsp;&nbsp;&nbsp;th[read] resume \<nnn\> resume thread nnn  
&nbsp;&nbsp;&nbsp;p expression evaluate expression and print its value  
&nbsp;&nbsp;&nbsp;h[elp] print this help  
&nbsp;&nbsp;&nbsp;\<everything else\> evaluate  
(rdb:1)

> **···**
>
> On Fri, 25 May 2007, How do I use the ruby default debugger? wrote:
> 
> > How do I use the ruby default debugger?
> 
> --  
> -----------------------------------------------------------  
> &nbsp;&nbsp;&nbsp;Tomas Pospisek  
> &nbsp;&nbsp;&nbsp;[http://sourcepole.com](http://sourcepole.com) - Linux & Open Source Solutions  
> -----------------------------------------------------------

---

<div class="post-metadata">

**Author:** ![Alexey\_Verkhovsky1](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alexey\_Verkhovsky1](https://rubytalk.org/u/Alexey_Verkhovsky1)\
**Post date:** [24 May 2007 20:58 UTC](https://rubytalk.org/t/ruby-debugging/37820/3 "2007-05-24T20:58:23Z")

</div>

Just don't. ruby-debug is a much better alternative.

Alex

> **···**
>
> On 5/24/07, How do I use the ruby default debugger? \<jbucaran@gmail.com\> wrote:
> 
> > How do I use the ruby default debugger?

---

<div class="post-metadata">

**Author:** ![How\_do\_I\_use\_the\_rub](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@How\_do\_I\_use\_the\_rub](https://rubytalk.org/u/How_do_I_use_the_rub)\
**Post date:** [25 May 2007 02:37 UTC](https://rubytalk.org/t/ruby-debugging/37820/4 "2007-05-25T02:37:40Z")

</div>

Tomas Pospisek's Mailing Lists wrote:

> > How do I use the ruby default debugger?
> 
> $ ruby -rdebug /tmp/some\_ruby\_program.rb  
> Debug.rb  
> Emacs support available.
> 
> /tmp/k.rb:1:puts "a"  
> (rdb:1) help  
> Debugger help v.-0.002b  
> Commands  
> &nbsp;&nbsp;&nbsp;b[reak] [file:|class:]\<line|method\>  
> &nbsp;&nbsp;&nbsp;b[reak] [class.]\<line|method\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set breakpoint to some position  
> &nbsp;&nbsp;&nbsp;wat[ch] \<expression\> set watchpoint to some expression  
> &nbsp;&nbsp;&nbsp;cat[ch] (\<exception\>|off) set catchpoint to an exception  
> &nbsp;&nbsp;&nbsp;b[reak] list breakpoints  
> &nbsp;&nbsp;&nbsp;cat[ch] show catchpoint  
> &nbsp;&nbsp;&nbsp;del[ete][nnn] delete some or all breakpoints  
> &nbsp;&nbsp;&nbsp;disp[lay] \<expression\> add expression into display expression  
> list  
> &nbsp;&nbsp;&nbsp;undisp[lay][nnn] delete one particular or all display  
> expressions  
> &nbsp;&nbsp;&nbsp;c[ont] run until program ends or hit breakpoint  
> &nbsp;&nbsp;&nbsp;s[tep][nnn] step (into methods) one line or till line  
> nnn  
> &nbsp;&nbsp;&nbsp;n[ext][nnn] go over one line or till line nnn  
> &nbsp;&nbsp;&nbsp;w[here] display frames  
> &nbsp;&nbsp;&nbsp;f[rame] alias for where  
> &nbsp;&nbsp;&nbsp;l[ist][(-|nn-mm)] list program, - lists backwards  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nn-mm lists given lines  
> &nbsp;&nbsp;&nbsp;up[nn] move to higher frame  
> &nbsp;&nbsp;&nbsp;down[nn] move to lower frame  
> &nbsp;&nbsp;&nbsp;fin[ish] return to outer frame  
> &nbsp;&nbsp;&nbsp;tr[ace] (on|off) set trace mode of current thread  
> &nbsp;&nbsp;&nbsp;tr[ace] (on|off) all set trace mode of all threads  
> &nbsp;&nbsp;&nbsp;q[uit] exit from debugger  
> &nbsp;&nbsp;&nbsp;v[ar] g[lobal] show global variables  
> &nbsp;&nbsp;&nbsp;v[ar] l[ocal] show local variables  
> &nbsp;&nbsp;&nbsp;v[ar] i[nstance] \<object\> show instance variables of object  
> &nbsp;&nbsp;&nbsp;v[ar] c[onst] \<object\> show constants of object  
> &nbsp;&nbsp;&nbsp;m[ethod] i[nstance] \<obj\> show methods of object  
> &nbsp;&nbsp;&nbsp;m[ethod] \<class|module\> show instance methods of class or module  
> &nbsp;&nbsp;&nbsp;th[read] l[ist] list all threads  
> &nbsp;&nbsp;&nbsp;th[read] c[ur[rent]] show current thread  
> &nbsp;&nbsp;&nbsp;th[read] [sw[itch]] \<nnn\> switch thread context to nnn  
> &nbsp;&nbsp;&nbsp;th[read] stop \<nnn\> stop thread nnn  
> &nbsp;&nbsp;&nbsp;th[read] resume \<nnn\> resume thread nnn  
> &nbsp;&nbsp;&nbsp;p expression evaluate expression and print its value  
> &nbsp;&nbsp;&nbsp;h[elp] print this help  
> &nbsp;&nbsp;&nbsp;\<everything else\> evaluate  
> (rdb:1)
> 
> --

Look what happened when I did just that:

C:\Users\jbucaran\>ruby -rdebug  
c:\users\jbucaran\desktop\demo2.rb  
Debug.rb  
Emacs support available.

C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
'rubygems'  
(rdb:1)

Help me I am clueless!

> **···**
>
> > On Fri, 25 May 2007, How do I use the ruby default debugger? wrote:
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Alex\_Gutteridge](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alex\_Gutteridge](https://rubytalk.org/u/Alex_Gutteridge)\
**Post date:** [25 May 2007 03:02 UTC](https://rubytalk.org/t/ruby-debugging/37820/5 "2007-05-25T03:02:08Z")

</div>

> Tomas Pospisek's Mailing Lists wrote:
> 
> > > How do I use the ruby default debugger?
> > 
> > $ ruby -rdebug /tmp/some\_ruby\_program.rb  
> > Debug.rb  
> > Emacs support available.
> > 
> > /tmp/k.rb:1:puts "a"  
> > (rdb:1) help  
> > Debugger help v.-0.002b  
> > Commands  
> > --

[snip]

> Look what happened when I did just that:
> 
> C:\Users\jbucaran\>ruby -rdebug  
> c:\users\jbucaran\desktop\demo2.rb  
> Debug.rb  
> Emacs support available.
> 
> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
> 'rubygems'  
> (rdb:1)
> 
> Help me I am clueless!

The debugger is running and now you need to use it. Type help (as shown above) to get a list of commands. You probably want to set breakpoints at certain places in your script and then continue to there using 'c' before you step through using 'n' or 's'. Googling for 'ruby debugger' gives me the Pickaxe chapter on debugging which is a good starting point if none of this makes sense.

Alex Gutteridge

Bioinformatics Center  
Kyoto University

> **···**
>
> On 25 May 2007, at 11:37, Jorge Domenico Bucaran Romano wrote:
> 
> > > On Fri, 25 May 2007, How do I use the ruby default debugger? wrote:

---

<div class="post-metadata">

**Author:** ![Alexey\_Verkhovsky1](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alexey\_Verkhovsky1](https://rubytalk.org/u/Alexey_Verkhovsky1)\
**Post date:** [25 May 2007 03:07 UTC](https://rubytalk.org/t/ruby-debugging/37820/6 "2007-05-25T03:07:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![How\_do\_I\_use\_the\_rub](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@How\_do\_I\_use\_the\_rub](https://rubytalk.org/u/How_do_I_use_the_rub)\
**Post date:** [25 May 2007 03:12 UTC](https://rubytalk.org/t/ruby-debugging/37820/7 "2007-05-25T03:12:41Z")

</div>

Alex Gutteridge wrote:

> > > (rdb:1) help  
> > > Debugger help v.-0.002b  
> > > Commands  
> > > --
> 
> [snip]
> 
> > 'rubygems'  
> > (rdb:1)
> > 
> > Help me I am clueless!
> 
> The debugger is running and now you need to use it. Type help (as  
> shown above) to get a list of commands. You probably want to set  
> breakpoints at certain places in your script and then continue to  
> there using 'c' before you step through using 'n' or 's'. Googling  
> for 'ruby debugger' gives me the Pickaxe chapter on debugging which  
> is a good starting point if none of this makes sense.
> 
> Alex Gutteridge
> 
> Bioinformatics Center  
> Kyoto University

I prefer using the Ruby default debugger since I am planning to build a  
GUI for it, the minimal functionality. I try to use the debugger but it  
just seems to be in the wrong file look at this:

C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
Debug.rb  
Emacs support available.

C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
'rubygems'  
(rdb:1) list  
[5, 14] in C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb  
&nbsp;&nbsp;&nbsp;5 # All rights reserved.  
&nbsp;&nbsp;&nbsp;6 # See LICENSE.txt for permissions.  
&nbsp;&nbsp;&nbsp;7 #++  
&nbsp;&nbsp;&nbsp;8  
&nbsp;&nbsp;&nbsp;9  
=\> 10 require 'rubygems'  
(rdb:1) list all  
[-5, 4] in C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb  
&nbsp;&nbsp;&nbsp;1 # This file allows for the running of rubygems with a nice  
&nbsp;&nbsp;&nbsp;2 # command line look-and-feel: ruby -rubygems foo.rb  
&nbsp;&nbsp;&nbsp;3 #--  
&nbsp;&nbsp;&nbsp;4 # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and  
others.  
(rdb:1)

> **···**
>
> > On 25 May 2007, at 11:37, Jorge Domenico Bucaran Romano wrote:
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![How\_do\_I\_use\_the\_rub](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@How\_do\_I\_use\_the\_rub](https://rubytalk.org/u/How_do_I_use_the_rub)\
**Post date:** [25 May 2007 03:18 UTC](https://rubytalk.org/t/ruby-debugging/37820/8 "2007-05-25T03:18:47Z")

</div>

Also, why does it shows this:

C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
'rubygems'

Not that I care much about it, since all I want to be able to debug, but  
I'd like to know what is it.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Alex\_Gutteridge](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alex\_Gutteridge](https://rubytalk.org/u/Alex_Gutteridge)\
**Post date:** [25 May 2007 03:51 UTC](https://rubytalk.org/t/ruby-debugging/37820/9 "2007-05-25T03:51:07Z")

</div>

You've told it (via your environment settings from looking at that line) to load rubygems. Loading rubygems executes Ruby code. The debugger is preparing to debug that code. Once you are past that code you can start to debug your program.

As I said, you need to set breakpoints in your script and jump to those breakpoints. E.g:

[alexg@powerbook]/Users/alexg/Desktop(7): cat test.rb  
a=1  
puts a  
[alexg@powerbook]/Users/alexg/Desktop(8): ruby -rdebug -rubygems test.rb  
Debug.rb  
Emacs support available.

/usr/local/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require 'rubygems'  
(rdb:1) b test.rb:1  
Set breakpoint 1 at test.rb:1  
(rdb:1) c  
Breakpoint 1, toplevel at test.rb:1  
test.rb:1:a=1  
(rdb:1) list  
[-4, 5] in test.rb  
=\> 1 a=1  
&nbsp;&nbsp;&nbsp;&nbsp;2 puts a  
(rdb:1)

Alex Gutteridge

Bioinformatics Center  
Kyoto University

> **···**
>
> On 25 May 2007, at 12:18, Jorge Domenico Bucaran Romano wrote:
> 
> > Also, why does it shows this:
> > 
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
> > 'rubygems'
> > 
> > Not that I care much about it, since all I want to be able to debug, but  
> > I'd like to know what is it.
> > 
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![How\_do\_I\_use\_the\_rub](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@How\_do\_I\_use\_the\_rub](https://rubytalk.org/u/How_do_I_use_the_rub)\
**Post date:** [25 May 2007 04:16 UTC](https://rubytalk.org/t/ruby-debugging/37820/10 "2007-05-25T04:16:46Z")

</div>

Is it necessary to load the rubygems when debugging? Why do I need this?  
If not really necessary how do I remove it from my enviroment settings?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![How\_do\_I\_use\_the\_rub](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@How\_do\_I\_use\_the\_rub](https://rubytalk.org/u/How_do_I_use_the_rub)\
**Post date:** [25 May 2007 04:18 UTC](https://rubytalk.org/t/ruby-debugging/37820/11 "2007-05-25T04:18:06Z")

</div>

It is not working look at this:

C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
Debug.rb  
Emacs support available.

C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
'rubygems'  
(rdb:1) help  
Debugger help v.-0.002b  
Commands  
&nbsp;&nbsp;b[reak] [file:|class:]\<line|method\>  
&nbsp;&nbsp;b[reak] [class.]\<line|method\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set breakpoint to some position  
&nbsp;&nbsp;wat[ch] \<expression\> set watchpoint to some expression  
&nbsp;&nbsp;cat[ch] (\<exception\>|off) set catchpoint to an exception  
&nbsp;&nbsp;b[reak] list breakpoints  
&nbsp;&nbsp;cat[ch] show catchpoint  
&nbsp;&nbsp;del[ete][nnn] delete some or all breakpoints  
&nbsp;&nbsp;disp[lay] \<expression\> add expression into display expression list  
&nbsp;&nbsp;undisp[lay][nnn] delete one particular or all display  
expressions  
&nbsp;&nbsp;c[ont] run until program ends or hit breakpoint  
&nbsp;&nbsp;s[tep][nnn] step (into methods) one line or till line  
nnn  
&nbsp;&nbsp;n[ext][nnn] go over one line or till line nnn  
&nbsp;&nbsp;w[here] display frames  
&nbsp;&nbsp;f[rame] alias for where  
&nbsp;&nbsp;l[ist][(-|nn-mm)] list program, - lists backwards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nn-mm lists given lines  
&nbsp;&nbsp;up[nn] move to higher frame  
&nbsp;&nbsp;down[nn] move to lower frame  
&nbsp;&nbsp;fin[ish] return to outer frame  
&nbsp;&nbsp;tr[ace] (on|off) set trace mode of current thread  
&nbsp;&nbsp;tr[ace] (on|off) all set trace mode of all threads  
&nbsp;&nbsp;q[uit] exit from debugger  
&nbsp;&nbsp;v[ar] g[lobal] show global variables  
&nbsp;&nbsp;v[ar] l[ocal] show local variables  
&nbsp;&nbsp;v[ar] i[nstance] \<object\> show instance variables of object  
&nbsp;&nbsp;v[ar] c[onst] \<object\> show constants of object  
&nbsp;&nbsp;m[ethod] i[nstance] \<obj\> show methods of object  
&nbsp;&nbsp;m[ethod] \<class|module\> show instance methods of class or module  
&nbsp;&nbsp;th[read] l[ist] list all threads  
&nbsp;&nbsp;th[read] c[ur[rent]] show current thread  
&nbsp;&nbsp;th[read] [sw[itch]] \<nnn\> switch thread context to nnn  
&nbsp;&nbsp;th[read] stop \<nnn\> stop thread nnn  
&nbsp;&nbsp;th[read] resume \<nnn\> resume thread nnn  
&nbsp;&nbsp;p expression evaluate expression and print its value  
&nbsp;&nbsp;h[elp] print this help  
&nbsp;&nbsp;\<everything else\> evaluate  
(rdb:1) b c:\users\jbucaran\desktop\demo2.rb  
C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: syntax  
error, unexpe  
cted $undefined, expecting tSTRING\_CONTENT or tSTRING\_DBEG or  
tSTRING\_DVAR or tS  
TRING\_END  
c:\users\jbucaran\desktop\demo2  
&nbsp;&nbsp;&nbsp;^  
(rdb:1) Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1  
C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: warning:  
parenthesiz  
e argument(s) for future version  
C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: syntax  
error, unexpe  
cted tIDENTIFIER, expecting $end  
Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
(rdb:1)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Alex\_Gutteridge](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alex\_Gutteridge](https://rubytalk.org/u/Alex_Gutteridge)\
**Post date:** [25 May 2007 04:42 UTC](https://rubytalk.org/t/ruby-debugging/37820/12 "2007-05-25T04:42:14Z")

</div>

> It is not working look at this:
> 
> C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
> Debug.rb  
> Emacs support available.
> 
> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
> 'rubygems'  
> (rdb:1) help  
> Debugger help v.-0.002b

[snip]

> (rdb:1) b c:\users\jbucaran\desktop\demo2.rb  
> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: syntax  
> error, unexpe  
> cted $undefined, expecting tSTRING\_CONTENT or tSTRING\_DBEG or  
> tSTRING\_DVAR or tS  
> TRING\_END  
> c:\users\jbucaran\desktop\demo2  
> &nbsp;&nbsp;&nbsp;^  
> (rdb:1) Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1  
> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: warning:  
> parenthesiz  
> e argument(s) for future version  
> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: syntax  
> error, unexpe  
> cted tIDENTIFIER, expecting $end  
> Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
> (rdb:1)
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

It's telling you that there is a syntax error in the way you specified the filename. I don't use Windows so I can't test exactly, but it looks like enclosing the filename in quotes might help. Alternatively substitute backslash for forward slash. E.g:

b "c:\users\jbucaran\desktop\demo2.rb":1

Also, don't type in this line:

Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1

That is output from the debugger.

As to your question about whether it is necessary to run rubygems to use the debugger then the answer is 'it depends'. If your script uses gems then it is necessary, otherwise it isn't. I don't know anything about environment variables in Windows, so someone else will have to help you there. I would have thought that you should be able to get some information from Google.

Alex Gutteridge

Bioinformatics Center  
Kyoto University

> **···**
>
> On 25 May 2007, at 13:18, Jorge Domenico Bucaran Romano wrote:

---

<div class="post-metadata">

**Author:** ![Leslie\_Viljoen1](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@Leslie\_Viljoen1](https://rubytalk.org/u/Leslie_Viljoen1)\
**Post date:** [25 May 2007 20:13 UTC](https://rubytalk.org/t/ruby-debugging/37820/13 "2007-05-25T20:13:03Z")

</div>

It looks to me like the debugger is getting confused by the colon after C  
drive.  
The usage for the 'b' command: b[reak] [file:|class:]\<line|method\>  
See? You can specify a file and then a colon and the class etc. but the  
debugger is not expecting a colon in the path.

Try just "b 1" to set a breakpoint on line 1.

Les

> **···**
>
> On 5/25/07, Jorge Domenico Bucaran Romano \<jbucaran@gmail.com\> wrote:
> 
> > (rdb:1) b c:\users\jbucaran\desktop\demo2.rb  
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: syntax  
> > error, unexpe  
> > cted $undefined, expecting tSTRING\_CONTENT or tSTRING\_DBEG or  
> > tSTRING\_DVAR or tS  
> > TRING\_END  
> > c:\users\jbucaran\desktop\demo2  
> > &nbsp;&nbsp;&nbsp;^  
> > (rdb:1) Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1  
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: warning:  
> > parenthesiz  
> > e argument(s) for future version  
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: syntax  
> > error, unexpe  
> > cted tIDENTIFIER, expecting $end  
> > Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
> > (rdb:1)

---

<div class="post-metadata">

**Author:** ![How\_do\_I\_use\_the\_rub](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@How\_do\_I\_use\_the\_rub](https://rubytalk.org/u/How_do_I_use_the_rub)\
**Post date:** [25 May 2007 05:27 UTC](https://rubytalk.org/t/ruby-debugging/37820/14 "2007-05-25T05:27:22Z")

</div>

C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
Debug.rb  
Emacs support available.

C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
'rubygems'  
(rdb:1) b "c:\users\jbucaran\desktop\demo2.rb"  
C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: unterminated  
string  
meets end of file  
(rdb:1)

I am sorry to bother like this, but is there any way I could get serious  
documentation on how to use this, a good tutorial, maybe you can help me  
here with a fine start. Please I can't believe it is so hard to do this.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Leslie\_Viljoen1](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@Leslie\_Viljoen1](https://rubytalk.org/u/Leslie_Viljoen1)\
**Post date:** [25 May 2007 20:26 UTC](https://rubytalk.org/t/ruby-debugging/37820/15 "2007-05-25T20:26:10Z")

</div>

Some tests show that this doesn't help you much.  
And I see ruby-breakpoint is currently broken for Windows... sorry!

To be honest, I have never really used the debugger in Ruby, and most people  
I know don't use it either -  
perhaps because of problems like this. I use ruby-breakpoint from time to  
time on Linux. Other than that  
I find that a few small unit tests and the occasional 'p variable; exit'  
somewhere in my code are all I need to  
figure out what the problem is.

Les

> **···**
>
> On 5/25/07, Leslie Viljoen \<leslieviljoen@gmail.com\> wrote:
> 
> > On 5/25/07, Jorge Domenico Bucaran Romano \<jbucaran@gmail.com\> wrote:  
> > \>  
> > \> (rdb:1) b c:\users\jbucaran\desktop\demo2.rb  
> > \> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > \> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: syntax  
> > \> error, unexpe  
> > \> cted $undefined, expecting tSTRING\_CONTENT or tSTRING\_DBEG or  
> > \> tSTRING\_DVAR or tS  
> > \> TRING\_END  
> > \> c:\users\jbucaran\desktop\demo2  
> > \> ^  
> > \> (rdb:1) Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1  
> > \> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: warning:  
> > \> parenthesiz  
> > \> e argument(s) for future version  
> > \> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > \> C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: syntax  
> > \> error, unexpe  
> > \> cted tIDENTIFIER, expecting $end  
> > \> Set breakpoint 1 at c:\users\jbucaran\desktop\demo2.rb:1  
> > \> ^  
> > \> (rdb:1)
> > 
> > It looks to me like the debugger is getting confused by the colon after C  
> > drive.  
> > The usage for the 'b' command: b[reak] [file:|class:]\<line|method\>  
> > See? You can specify a file and then a colon and the class etc. but the  
> > debugger is not expecting a colon in the path.
> > 
> > Try just "b 1" to set a breakpoint on line 1.
> > 
> > Les
> 
> --  
> If you could create a machine that copies hamburgers — you put one hamburger  
> in and two equally good hamburgers come out the other side — it would be  
> unethical not to do so and make it freely available.

---

<div class="post-metadata">

**Author:** ![Tomas\_Pospisek](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@Tomas\_Pospisek](https://rubytalk.org/u/Tomas_Pospisek)\
**Post date:** [25 May 2007 06:42 UTC](https://rubytalk.org/t/ruby-debugging/37820/16 "2007-05-25T06:42:13Z")

</div>

Did you ask Google?

In your example above a file named "ubygems" is being parsed. Looks like non-sense to me?  
\*t

> **···**
>
> On Fri, 25 May 2007, Jorge Domenico Bucaran Romano wrote:
> 
> > C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
> > Debug.rb  
> > Emacs support available.
> > 
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
> > 'rubygems'  
> > (rdb:1) b "c:\users\jbucaran\desktop\demo2.rb"  
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: unterminated  
> > string  
> > meets end of file  
> > (rdb:1)
> > 
> > I am sorry to bother like this, but is there any way I could get serious  
> > documentation on how to use this, a good tutorial, maybe you can help me  
> > here with a fine start. Please I can't believe it is so hard to do this.
> 
> --  
> -----------------------------------------------------------  
> &nbsp;&nbsp;&nbsp;Tomas Pospisek  
> &nbsp;&nbsp;&nbsp;[http://sourcepole.com](http://sourcepole.com) - Linux & Open Source Solutions  
> -----------------------------------------------------------

---

<div class="post-metadata">

**Author:** ![Alex\_Gutteridge](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alex\_Gutteridge](https://rubytalk.org/u/Alex_Gutteridge)\
**Post date:** [25 May 2007 07:19 UTC](https://rubytalk.org/t/ruby-debugging/37820/17 "2007-05-25T07:19:25Z")

</div>

ubygems.rb is the way rubygems is loaded when you run:

ruby -rubygems

I don't think that is anything to do with the problem Jorge is having. I'm not sure what the problem is do with though and I can't reproduce it on my system. Sorry I can't be off more help. The only tutorial I know of is the Pickaxe chapter on debugging - but there's not much to it to be honest:

[http://www.rubycentral.com/book/trouble.html](http://www.rubycentral.com/book/trouble.html)

Alex Gutteridge

Bioinformatics Center  
Kyoto University

> **···**
>
> On 25 May 2007, at 15:42, Tomas Pospisek's Mailing Lists wrote:
> 
> > On Fri, 25 May 2007, Jorge Domenico Bucaran Romano wrote:
> > 
> > > C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
> > > Debug.rb  
> > > Emacs support available.
> > > 
> > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
> > > 'rubygems'  
> > > (rdb:1) b "c:\users\jbucaran\desktop\demo2.rb"  
> > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: unterminated  
> > > string  
> > > meets end of file  
> > > (rdb:1)
> > > 
> > > I am sorry to bother like this, but is there any way I could get serious  
> > > documentation on how to use this, a good tutorial, maybe you can help me  
> > > here with a fine start. Please I can't believe it is so hard to do this.
> > 
> > Did you ask Google?
> > 
> > In your example above a file named "ubygems" is being parsed. Looks like non-sense to me?  
> > \*t

---

<div class="post-metadata">

**Author:** ![Tomas\_Pospisek](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@Tomas\_Pospisek](https://rubytalk.org/u/Tomas_Pospisek)\
**Post date:** [25 May 2007 07:50 UTC](https://rubytalk.org/t/ruby-debugging/37820/18 "2007-05-25T07:50:24Z")

</div>

Where "-rXYZ" means: "Please ruby, load the library XYZ first please, before loading the actual program". And as can be seen above, ruby does actually find a file/library named "ubygems" at  
"C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb" which doesn't make any sense to me because (AFAIK) there doesn't exist and library named "ubygems" unless Jorge did something strange and placed something there.

Or am I misstaken?  
\*t

> **···**
>
> On Fri, 25 May 2007, Alex Gutteridge wrote:
> 
> > On 25 May 2007, at 15:42, Tomas Pospisek's Mailing Lists wrote:
> > 
> > > On Fri, 25 May 2007, Jorge Domenico Bucaran Romano wrote:
> > > 
> > > > C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
> > > > Debug.rb  
> > > > Emacs support available.
> > > > 
> > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
> > > > 'rubygems'  
> > > > (rdb:1) b "c:\users\jbucaran\desktop\demo2.rb"  
> > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: unterminated  
> > > > string  
> > > > meets end of file  
> > > > (rdb:1)
> > > > 
> > > > I am sorry to bother like this, but is there any way I could get serious  
> > > > documentation on how to use this, a good tutorial, maybe you can help me  
> > > > here with a fine start. Please I can't believe it is so hard to do this.
> > > 
> > > Did you ask Google?
> > > 
> > > In your example above a file named "ubygems" is being parsed. Looks like non-sense to me?  
> > > \*t
> > 
> > ubygems.rb is the way rubygems is loaded when you run:
> > 
> > ruby -rubygems
> 
> --  
> -----------------------------------------------------------  
> &nbsp;&nbsp;&nbsp;Tomas Pospisek  
> &nbsp;&nbsp;&nbsp;[http://sourcepole.com](http://sourcepole.com) - Linux & Open Source Solutions  
> -----------------------------------------------------------

---

<div class="post-metadata">

**Author:** ![Alex\_Gutteridge](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alex\_Gutteridge](https://rubytalk.org/u/Alex_Gutteridge)\
**Post date:** [25 May 2007 08:17 UTC](https://rubytalk.org/t/ruby-debugging/37820/19 "2007-05-25T08:17:46Z")

</div>

ubygems \*is\* rubygems. This is getting off-topic, but ubygems.rb is the reason you can write the aesthetically pleasing:

ruby -rubygems foo.rb

As well as:

ruby -rrubygems foo.rb

Note the double rr in the second one. Every installation of rubygems includes ubygems.rb as far as I know. Try "locate '/ubygems.rb'" on your system.

Alex Gutteridge

Bioinformatics Center  
Kyoto University

> **···**
>
> On 25 May 2007, at 16:50, Tomas Pospisek's Mailing Lists wrote:
> 
> > On Fri, 25 May 2007, Alex Gutteridge wrote:
> > 
> > > On 25 May 2007, at 15:42, Tomas Pospisek's Mailing Lists wrote:
> > > 
> > > > On Fri, 25 May 2007, Jorge Domenico Bucaran Romano wrote:
> > > > 
> > > > > C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
> > > > > Debug.rb  
> > > > > Emacs support available.  
> > > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
> > > > > 'rubygems'  
> > > > > (rdb:1) b "c:\users\jbucaran\desktop\demo2.rb"  
> > > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: unterminated  
> > > > > string  
> > > > > meets end of file  
> > > > > (rdb:1)  
> > > > > I am sorry to bother like this, but is there any way I could get serious  
> > > > > documentation on how to use this, a good tutorial, maybe you can help me  
> > > > > here with a fine start. Please I can't believe it is so hard to do this.
> > > > 
> > > > Did you ask Google?  
> > > > In your example above a file named "ubygems" is being parsed. Looks like non-sense to me?  
> > > > \*t
> > > 
> > > ubygems.rb is the way rubygems is loaded when you run:
> > > 
> > > ruby -rubygems
> > 
> > Where "-rXYZ" means: "Please ruby, load the library XYZ first please, before loading the actual program". And as can be seen above, ruby does actually find a file/library named "ubygems" at  
> > "C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb" which doesn't make any sense to me because (AFAIK) there doesn't exist and library named "ubygems" unless Jorge did something strange and placed something there.
> > 
> > Or am I misstaken?  
> > \*t

---

<div class="post-metadata">

**Author:** ![Tomas\_Pospisek](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@Tomas\_Pospisek](https://rubytalk.org/u/Tomas_Pospisek)\
**Post date:** [25 May 2007 08:35 UTC](https://rubytalk.org/t/ruby-debugging/37820/20 "2007-05-25T08:35:49Z")

</div>

Ah, you're right, somehow I had missed that the last time I had run  
locate '/ubygems.rb.

Thanks for the enlightening,  
\*t

> **···**
>
> On Fri, 25 May 2007, Alex Gutteridge wrote:
> 
> > On 25 May 2007, at 16:50, Tomas Pospisek's Mailing Lists wrote:
> > 
> > > On Fri, 25 May 2007, Alex Gutteridge wrote:
> > > 
> > > > On 25 May 2007, at 15:42, Tomas Pospisek's Mailing Lists wrote:
> > > > 
> > > > > On Fri, 25 May 2007, Jorge Domenico Bucaran Romano wrote:
> > > > > 
> > > > > > C:\Users\jbucaran\>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb  
> > > > > > Debug.rb  
> > > > > > Emacs support available.  
> > > > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:require  
> > > > > > 'rubygems'  
> > > > > > (rdb:1) b "c:\users\jbucaran\desktop\demo2.rb"  
> > > > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10:compile error  
> > > > > > C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb:10: unterminated  
> > > > > > string  
> > > > > > meets end of file  
> > > > > > (rdb:1)  
> > > > > > I am sorry to bother like this, but is there any way I could get serious  
> > > > > > documentation on how to use this, a good tutorial, maybe you can help me  
> > > > > > here with a fine start. Please I can't believe it is so hard to do this.
> > > > > 
> > > > > Did you ask Google?  
> > > > > In your example above a file named "ubygems" is being parsed. Looks like non-sense to me?  
> > > > > \*t
> > > > 
> > > > ubygems.rb is the way rubygems is loaded when you run:
> > > > 
> > > > ruby -rubygems
> > > 
> > > Where "-rXYZ" means: "Please ruby, load the library XYZ first please, before loading the actual program". And as can be seen above, ruby does actually find a file/library named "ubygems" at  
> > > "C:/Program Files/Ruby/lib/ruby/site\_ruby/1.8/ubygems.rb" which doesn't make any sense to me because (AFAIK) there doesn't exist and library named "ubygems" unless Jorge did something strange and placed something there.
> > > 
> > > Or am I misstaken?  
> > > \*t
> > 
> > ubygems \*is\* rubygems. This is getting off-topic, but ubygems.rb is the reason you can write the aesthetically pleasing:
> > 
> > ruby -rubygems foo.rb
> > 
> > As well as:
> > 
> > ruby -rrubygems foo.rb
> > 
> > Note the double rr in the second one. Every installation of rubygems includes ubygems.rb as far as I know. Try "locate '/ubygems.rb'" on your system.
> 
> --  
> -----------------------------------------------------------  
> &nbsp;&nbsp;&nbsp;Tomas Pospisek  
> &nbsp;&nbsp;&nbsp;[http://sourcepole.com](http://sourcepole.com) - Linux & Open Source Solutions  
> -----------------------------------------------------------

[Next page](https://rubytalk.org/t/ruby-debugging/37820.md?page=2)
