Ruby execution

can i execute ruby program step by step?
like c language…pressing F7… i can debug my program.
is there any way to do the same?
thanx

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sumanta D. wrote:
| can i execute ruby program step by step?
| like c language…pressing F7… i can debug my program.

That is not a feature of C, but the IDE you are using.

| is there any way to do the same?

Yes, actually.

gem install ruby-debug

Here’s a quick screencast introducing ruby-debug.

If you have ever used it, it is similar to gdb.


Phillip G.
Twitter: twitter.com/cynicalryan

~ How many boards would the Mongols hoard if the Mongol hordes got
bored?
– Calvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgDDicACgkQbtAgaoJTgL8icQCfYfcQhjrlfWNlRv87P0KVSv9z
xPAAn1nDRy7QYoq9aug8jSI0kFJ4KEqJ
=mq/p
-----END PGP SIGNATURE-----

Sumanta D. wrote:

can i execute ruby program step by step?
like c language…pressing F7… i can debug my program.
is there any way to do the same?
thanx

ruby -r debug mypgm.rb

Type h at the prompt for help.

But, is there a way to “debug” just within a particular method? That way
one
can skip the rest of the code, which we know “works” fine.

Thanks

Victor

I followed the link. Thanks for the info!

Sumanta D. wrote:

can i execute ruby program step by step?
like c language…pressing F7… i can debug my program.
is there any way to do the same?
thanx

Hello Sumanta:

In addition to the other good suggestions made by others, you may want
to consider purchasing a ruby specific IDE that supports debugging such
as Arachno Ruby:

http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php

Michael

Victor R. wrote:

But, is there a way to “debug” just within a particular method? That way
one
can skip the rest of the code, which we know “works” fine.

Thanks

Victor

That appears to be a feature of the ruby-debug library. A quick Google
“ruby-debug” found this page:
http://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug.

Jim C. wrote:

as Arachno Ruby:

Hello Jim:

I can’t speak to the Linux version because I’ve only tried (and
purchased) the Windows version which is very good. I’m coming from
Delphi so something like this IDE really eases the shock. The only
significant thing missing compared to Delphi is a GUI builder but I can
understand why because there are so many GUI choices for Ruby (I’m
partial to wxRuby).

Might I suggest you download the 20 day trial of the Linux version of
Arachno Ruby and try it out. There support is good too… I had some
really stupid questions during the trial and they politely answered all
of them.

Michael

On 2008-04-15, Michael B. [email protected] wrote:

as Arachno Ruby:

http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php

Michael

Sorry for the side track, but how good/complete is the Linux version of
this IDE (for anyone who knows)?

Thanks.

On 2008-04-15, Michael B. [email protected] wrote:

to consider purchasing a ruby specific IDE that supports debugging such
Thanks.

Might I suggest you download the 20 day trial of the Linux version of
Arachno Ruby and try it out. There support is good too… I had some
really stupid questions during the trial and they politely answered all
of them.

Thanks, Michael, for the suggestion. I’ll consider checking out the
trial version when I’ve “gotten back into Ruby learning mode”. (I
started studying Ruby over a year ago, got sidetracked by a Perl job,
and want to get back into learning Ruby, hopefully soon.)

Victor R. wrote:

But, is there a way to “debug” just within a particular method? That way one
can skip the rest of the code, which we know “works” fine.
[snip]

Sure. Having recently learned the wonders of ruby-debug, I can tell you
this: you can set a breakpoint in the method, then step through it from
that point on, examining variables (and doing a lot of other useful
things) to your hearts content. When ready, you can resume regular
execution. Very nicely set up, I think you’ll find. And…it’s all
command line stuff.

t.

Tom C., MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< [email protected] >> (email)
<< TomCloyd.com >> (website & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)

Jim C. wrote:

is there any way to do the same?
Michael
I can’t speak to the Linux version because I’ve only tried (and

Thanks, Michael, for the suggestion. I’ll consider checking out the
trial version when I’ve “gotten back into Ruby learning mode”. (I
started studying Ruby over a year ago, got sidetracked by a Perl job,
and want to get back into learning Ruby, hopefully soon.)

Consider also trying the “community” (free) version - which is full
featured - of the Aptana Studio ide - it’s a full spectrum Ajax-Rails
etc. development environment, which encompasses ruby and ruby debugging
etc. It’s also java, so it’s big (but also obviously cross-platform). I
have been using it off and on for some time, and it’s very nice.
Excellent support from the developers, too - very good forums. Still in
development, but definitely far along and quite impressive.

t.

Tom C., MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< [email protected] >> (email)
<< TomCloyd.com >> (website & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs