Ruby - Debugging

How do I use the ruby default debugger?

···

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

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

--
-----------------------------------------------------------
   Tomas Pospisek
   http://sourcepole.com - Linux & Open Source Solutions
-----------------------------------------------------------

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?

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

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:

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

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
   5 # All rights reserved.
   6 # See LICENSE.txt for permissions.
   7 #++
   8
   9
=> 10 require 'rubygems'
(rdb:1) list all
[-5, 4] in C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/ubygems.rb
   1 # This file allows for the running of rubygems with a nice
   2 # command line look-and-feel: ruby -rubygems foo.rb
   3 #--
   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/\.

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/.

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
    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/\.

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/.

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

···

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

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
   ^
(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)

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

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:

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
   ^
(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)

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/.

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.

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.

--
-----------------------------------------------------------
   Tomas Pospisek
   http://sourcepole.com - Linux & Open Source Solutions
-----------------------------------------------------------

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

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

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

--
-----------------------------------------------------------
   Tomas Pospisek
   http://sourcepole.com - Linux & Open Source Solutions
-----------------------------------------------------------

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

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.

--
-----------------------------------------------------------
   Tomas Pospisek
   http://sourcepole.com - Linux & Open Source Solutions
-----------------------------------------------------------