From: Leslie Viljoen Date: 2007-05-29T16:55:53+09:00 Subject: Re: Ruby - Debugging ------=_Part_179307_7256198.1180425343299 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 5/26/07, Jorge Domenico Bucaran Romano wrote: > > Leslie Viljoen wrote: > > On 5/25/07, Jorge Domenico Bucaran Romano wrote: > >> puts a > >> Posted via http://www.ruby-forum.com/. > > Ok, I have something. > > > > I saved your little program as "test.rb". When you set the breakpoint, > > just > > use the filename, not the path. > > Here's my session: > > > > C:\Documents and Settings\lesliev>ruby -rdebug test.rb > > Debug.rb > > Emacs support available. > > > > c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:require 'rubygems' > > (rdb:1) b test.rb:3 > > Set breakpoint 1 at test.rb:3 > > (rdb:1) list > > [5, 14] in c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb > > 5 # All rights reserved. > > 6 # See LICENSE.txt for permissions. > > 7 #++ > > 8 > > 9 > > =3D> 10 require 'rubygems' > > (rdb:1) run > > c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:undefined local variable o= r > > method `run' for main:Object > > (rdb:1) c > > Breakpoint 1, toplevel at test.rb:3 > > test.rb:3:puts a > > (rdb:1) list > > [-2, 7] in test.rb > > 1 > > 2 a =3D 2 > > =3D> 3 puts a > > 4 a =3D 3 > > 5 puts a > > 6 > > 7 > > (rdb:1) > > > > > > > > > > Les > > Great! It worked. Thank you Les, now I have a lot work to do. > > The last thing I need your help with is: > > 1. Why do I need the rubygems when debugging? > R. In case I am debugging an applicacion that uses the rubygems > extension. RugyGems is a platform independent packaging system for Ruby. It lets you install "gems", which are packages. It gets loaded up before the debugging starts. For more info on it, look here: http://rubygems.org/ 2. Does that means that I need to include any library I am also > debugging? If so: > > 2.1. How do I add one? > 2.2. How do I delete one? In Ruby you use "require" to load libraries. This is a Ruby basic, so you really should do some reading on these things. It will take an extremely long time to learn Ruby by asking these sorts of questions in the forum! Try out one of the basic tutorials/manuals: http://pine.fm/LearnToProgram/ http://www.rubycentral.com/book/ http://poignantguide.net/ruby/ --=20 If you could create a machine that copies hamburgers =97 you put one hambur= ger in and two equally good hamburgers come out the other side =97 it would be unethical not to do so and make it freely available. ------=_Part_179307_7256198.1180425343299--