# Ruby execution

**URL:** <https://rubytalk.org/t/ruby-execution/45857>\
**Category:** ruby-talk\
**Created:** [14 April 2008 07:39 UTC](https://rubytalk.org/t/ruby-execution/45857 "2008-04-14T07:39:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sumanta\_Das](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@Sumanta\_Das](https://rubytalk.org/u/Sumanta_Das)\
**Post date:** [14 April 2008 07:39 UTC](https://rubytalk.org/t/ruby-execution/45857/1 "2008-04-14T07:39:26Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Phil](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@Phil](https://rubytalk.org/u/Phil)\
**Post date:** [14 April 2008 07:56 UTC](https://rubytalk.org/t/ruby-execution/45857/2 "2008-04-14T07:56:22Z")

</div>

Sumanta Das 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 Gawlowski  
Twitter: twitter.com/cynicalryan

~ How many boards would the Mongols hoard if the Mongol hordes got bored?  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-- Calvin

---

<div class="post-metadata">

**Author:** ![Tim\_Hunter4](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@Tim\_Hunter4](https://rubytalk.org/u/Tim_Hunter4)\
**Post date:** [14 April 2008 11:31 UTC](https://rubytalk.org/t/ruby-execution/45857/3 "2008-04-14T11:31:44Z")

</div>

Sumanta Das 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.

> **···**
>
> --  
> RMagick: [http://rmagick.rubyforge.org/](http://rmagick.rubyforge.org/)  
> RMagick 2: [http://rmagick.rubyforge.org/rmagick2.html](http://rmagick.rubyforge.org/rmagick2.html)

---

<div class="post-metadata">

**Author:** ![Michael\_Brooks](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Michael\_Brooks](https://rubytalk.org/u/Michael_Brooks)\
**Post date:** [15 April 2008 02:10 UTC](https://rubytalk.org/t/ruby-execution/45857/4 "2008-04-15T02:10:28Z")

</div>

Sumanta Das 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](http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php)

Michael

---

<div class="post-metadata">

**Author:** ![Victor\_Reyes](https://avatars.discourse-cdn.com/v4/letter/v/ed655f/32.png) [@Victor\_Reyes](https://rubytalk.org/u/Victor_Reyes)\
**Post date:** [14 April 2008 13:50 UTC](https://rubytalk.org/t/ruby-execution/45857/5 "2008-04-14T13:50:33Z")

</div>

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

> **···**
>
> On Mon, Apr 14, 2008 at 7:31 AM, Tim Hunter \<TimHunter@nc.rr.com\> wrote:
> 
> > Sumanta Das 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.
> > 
> > --  
> > RMagick: [http://rmagick.rubyforge.org/](http://rmagick.rubyforge.org/)  
> > RMagick 2: [http://rmagick.rubyforge.org/rmagick2.html](http://rmagick.rubyforge.org/rmagick2.html)

---

<div class="post-metadata">

**Author:** ![Jim\_Cochrane](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@Jim\_Cochrane](https://rubytalk.org/u/Jim_Cochrane)\
**Post date:** [15 April 2008 02:20 UTC](https://rubytalk.org/t/ruby-execution/45857/6 "2008-04-15T02:20:06Z")

</div>

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 Brooks \<michael.brooks@shaw.ca\> wrote:
> 
> > Sumanta Das 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](http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php)
> > 
> > Michael
> 
> --

---

<div class="post-metadata">

**Author:** ![Tim\_Hunter1](https://avatars.discourse-cdn.com/v4/letter/t/3ec8ea/32.png) [@Tim\_Hunter1](https://rubytalk.org/u/Tim_Hunter1)\
**Post date:** [14 April 2008 14:02 UTC](https://rubytalk.org/t/ruby-execution/45857/7 "2008-04-14T14:02:31Z")

</div>

Victor Reyes 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:  
[DATANOISE.COM](http://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug%5C).

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

---

<div class="post-metadata">

**Author:** ![Michael\_Brooks](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Michael\_Brooks](https://rubytalk.org/u/Michael_Brooks)\
**Post date:** [15 April 2008 04:05 UTC](https://rubytalk.org/t/ruby-execution/45857/8 "2008-04-15T04:05:03Z")

</div>

Jim Cochrane wrote:

> > Sumanta Das 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](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.

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 Brooks \<michael.brooks@shaw.ca\> wrote:

---

<div class="post-metadata">

**Author:** ![Tom\_Cloyd2](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@Tom\_Cloyd2](https://rubytalk.org/u/Tom_Cloyd2)\
**Post date:** [17 April 2008 01:51 UTC](https://rubytalk.org/t/ruby-execution/45857/9 "2008-04-17T01:51:08Z")

</div>

Victor Reyes 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 Cloyd, MS MA, LMHC  
> Private practice Psychotherapist  
> Bellingham, Washington, U.S.A: (360) 920-1226  
> \<\< tc@tomcloyd.com \>\> (email)  
> \<\< TomCloyd.com \>\> (website & psychotherapy weblog) \<\< sleightmind.wordpress.com \>\> (mental health issues weblog)  
> \<\< directpathdesign.com \>\> (web site design & consultation)  
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---

<div class="post-metadata">

**Author:** ![Victor\_Reyes](https://avatars.discourse-cdn.com/v4/letter/v/ed655f/32.png) [@Victor\_Reyes](https://rubytalk.org/u/Victor_Reyes)\
**Post date:** [14 April 2008 18:08 UTC](https://rubytalk.org/t/ruby-execution/45857/10 "2008-04-14T18:08:31Z")

</div>

I followed the link. Thanks for the info!

> **···**
>
> On Mon, Apr 14, 2008 at 10:02 AM, Tim Hunter \<rmagick@gmail.com\> wrote:
> 
> > Victor Reyes 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:  
> > [DATANOISE.COM](http://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug%5C).  
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Jim\_Cochrane](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@Jim\_Cochrane](https://rubytalk.org/u/Jim_Cochrane)\
**Post date:** [16 April 2008 22:35 UTC](https://rubytalk.org/t/ruby-execution/45857/11 "2008-04-16T22:35:14Z")

</div>

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

> **···**
>
> On 2008-04-15, Michael Brooks \<michael.brooks@shaw.ca\> wrote:
> 
> > Jim Cochrane wrote:
> > 
> > > On 2008-04-15, Michael Brooks \<michael.brooks@shaw.ca\> wrote:
> > > 
> > > > Sumanta Das 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](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.
> > 
> > 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.
> 
> --

---

<div class="post-metadata">

**Author:** ![Tom\_Cloyd2](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@Tom\_Cloyd2](https://rubytalk.org/u/Tom_Cloyd2)\
**Post date:** [17 April 2008 01:54 UTC](https://rubytalk.org/t/ruby-execution/45857/12 "2008-04-17T01:54:51Z")

</div>

Jim Cochrane wrote:

> &nbsp;&nbsp;
> 
> > Jim Cochrane wrote:  
> > &nbsp;&nbsp;&nbsp;&nbsp;
> > 
> > > > Sumanta Das wrote:  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> > > > 
> > > > > 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  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> > > > 
> > > > 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](http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php)
> > > > 
> > > > Michael  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> > > 
> > > Sorry for the side track, but how good/complete is the Linux version of  
> > > this IDE (for anyone who knows)?
> > > 
> > > Thanks.
> > 
> > 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.  
> > &nbsp;&nbsp;&nbsp;&nbsp;  
> > 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.

> **···**
>
> > On 2008-04-15, Michael Brooks \<michael.brooks@shaw.ca\> wrote:
> > 
> > > > On 2008-04-15, Michael Brooks \<michael.brooks@shaw.ca\> wrote:
> 
> --
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
> Tom Cloyd, MS MA, LMHC  
> Private practice Psychotherapist  
> Bellingham, Washington, U.S.A: (360) 920-1226  
> \<\< tc@tomcloyd.com \>\> (email)  
> \<\< TomCloyd.com \>\> (website & psychotherapy weblog) \<\< sleightmind.wordpress.com \>\> (mental health issues weblog)  
> \<\< directpathdesign.com \>\> (web site design & consultation)  
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
