[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

debugging question

eggman2001

10/18/2007 4:00:00 AM

I run this one gem with the command "foo <options>". I'd like to try
to run it off the foo.rb file so that I can debug it. However, when I
do "ruby path/to/foo.rb <options>" it doesn't behave in the same way
as "foo <options>". How do I need to run this program in order to
debug it?


16 Answers

Roger Pack

10/18/2007 1:54:00 PM

0

maybe first
require 'rubygems'
then require the file,
maybe run it from within that directory.
maybe do Dir.chdir to it, first, then require.

eggman2001 wrote:
> I run this one gem with the command "foo <options>". I'd like to try
> to run it off the foo.rb file so that I can debug it. However, when I
> do "ruby path/to/foo.rb <options>" it doesn't behave in the same way
> as "foo <options>". How do I need to run this program in order to
> debug it?

Specifics would be nice, as I don't quite understand what you're trying
to do. "run a gem"?
--
Posted via http://www.ruby-....

eggman2001

10/19/2007 2:48:00 AM

0

so I installed the gem rdig. You run rdig with "rdig <options>" and
I'd like to debug it.

On Oct 18, 9:53 am, Roger Pack <rogerpack2...@gmail.com> wrote:
> maybe first
> require 'rubygems'
> then require the file,
> maybe run it from within that directory.
> maybe do Dir.chdir to it, first, then require.
>
> eggman2001 wrote:
> > I run this one gem with the command "foo <options>". I'd like to try
> > to run it off the foo.rb file so that I can debug it. However, when I
> > do "ruby path/to/foo.rb <options>" it doesn't behave in the same way
> > as "foo <options>". How do I need to run this program in order to
> > debug it?
>
> Specifics would be nice, as I don't quite understand what you're trying
> to do. "run a gem"?
> --
> Posted viahttp://www.ruby-....


Roger Pack

10/19/2007 4:10:00 AM

0

eggman2001 wrote:
> so I installed the gem rdig. You run rdig with "rdig <options>" and
> I'd like to debug it.

gem install ruby-debug
rdebug rdig (maybe)
gl
--
Posted via http://www.ruby-....

eggman2001

10/19/2007 3:26:00 PM

0

I tried that, but it doesn't work.

Here's the error that I'm getting...
C:\InstantRails\ruby_progs\rdig_testing>rdeb
s\rdig_testing\config.rb
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
6:in `initialize': Bad file descriptor - con
from C:/InstantRails/ruby/lib/ruby/g
by-debug.rb:86:in `new'
from C:/InstantRails/ruby/lib/ruby/g
by-debug.rb:86:in `start_client'
from C:/InstantRails/ruby/lib/ruby/g
ebug:87
from C:/InstantRails/ruby/bin/rdebug
from C:/InstantRails/ruby/bin/rdebug

C:\InstantRails\ruby_progs\rdig_testing>

On Oct 19, 12:09 am, Roger Pack <rogerpack2...@gmail.com> wrote:
> eggman2001 wrote:
> > so I installed the gem rdig. You run rdig with "rdig <options>" and
> > I'd like to debug it.
>
> gem install ruby-debug
> rdebug rdig (maybe)
> gl
> --
> Posted viahttp://www.ruby-....


Roger Pack

10/19/2007 3:29:00 PM

0

checkout the topmost file line.
Maybe you're trying to run something on a port in use?

eggman2001 wrote:
> I tried that, but it doesn't work.
>
> Here's the error that I'm getting...
> C:\InstantRails\ruby_progs\rdig_testing>rdeb
> s\rdig_testing\config.rb
> C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
> 6:in `initialize': Bad file descriptor - con
> from C:/InstantRails/ruby/lib/ruby/g
> by-debug.rb:86:in `new'
> from C:/InstantRails/ruby/lib/ruby/g
> by-debug.rb:86:in `start_client'
> from C:/InstantRails/ruby/lib/ruby/g
> ebug:87
> from C:/InstantRails/ruby/bin/rdebug
> from C:/InstantRails/ruby/bin/rdebug
>
> C:\InstantRails\ruby_progs\rdig_testing>

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

eggman2001

10/19/2007 11:35:00 PM

0

Not quite sure what you mean - sorry. I know very little about the
role that ports play in these situations.

On Oct 19, 11:29 am, Roger Pack <rogerpack2...@gmail.com> wrote:
> checkout the topmost file line.
> Maybe you're trying to run something on a port in use?
>
>
>
> eggman2001 wrote:
> > I tried that, but it doesn't work.
>
> > Here's the error that I'm getting...
> > C:\InstantRails\ruby_progs\rdig_testing>rdeb
> > s\rdig_testing\config.rb
> > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
> > 6:in `initialize': Bad file descriptor - con
> > from C:/InstantRails/ruby/lib/ruby/g
> > by-debug.rb:86:in `new'
> > from C:/InstantRails/ruby/lib/ruby/g
> > by-debug.rb:86:in `start_client'
> > from C:/InstantRails/ruby/lib/ruby/g
> > ebug:87
> > from C:/InstantRails/ruby/bin/rdebug
> > from C:/InstantRails/ruby/bin/rdebug
>
> > C:\InstantRails\ruby_progs\rdig_testing>
>
> --
> Posted viahttp://www.ruby-....


Roger Pack

10/20/2007 4:08:00 PM

0

eggman2001 wrote:
> Not quite sure what you mean - sorry. I know very little about the
> role that ports play in these situations.

go into the rdig file (find it), then add
require 'ruby-debug'
debugger

and it should open a breakpoint for you there (run it normal).
GL!
-Roger
--
Posted via http://www.ruby-....

eggman2001

10/20/2007 11:50:00 PM

0

That worked! Thanks so much :-)

On Oct 20, 12:07 pm, Roger Pack <rogerpack2...@gmail.com> wrote:
> eggman2001 wrote:
> > Not quite sure what you mean - sorry. I know very little about the
> > role that ports play in these situations.
>
> go into the rdig file (find it), then add
> require 'ruby-debug'
> debugger
>
> and it should open a breakpoint for you there (run it normal).
> GL!
> -Roger
> --
> Posted viahttp://www.ruby-....


Jim G.

7/26/2013 5:13:00 PM

0

Rhino sent the following on Fri, 26 Jul 2013 12:43:42 -0400:
> On 2013-07-26 1:25 AM, David Johnston wrote:
> > They replaced the old junkie played by the guy from Republic of Doyle
> > with a different guy and wedged him into the storyline by revealing he
> > speaks German courtesy of having spend 5 years in German P.O.W. camps.
> > So apparently there's a reason for him to be messed up.
> >
> > You know, I don't think I've ever seen a bird watcher on a cop show who
> > wasn't a criminal.
>
> I can't imagine why a bird watcher would be more or less inclined to
> criminality than anyone else.
>
> I don't think I've ever seen a bird watcher on a cop show.
>
> In fact, the only bird-related observations I have is that Robert Blake
> had a parrot (or was it a cockatoo?) in Baretta which he seemed fond of.
> (I think I only ever saw the pilot of that show; I was not a regular
> watcher so I don't know if the bird lasted beyond the pilot.)
>
> In NYPD Blue, Jimmy Smits' character Bobby Simone had a friend named
> Pete who kept pigeons on the roof of his apartment. That figured into an
> episode or two. But I make a distinction between bird owners and bird
> watchers. Naturally, a bird owner will observe his own birds but a real
> bird watcher may travel hundreds or thousands of miles to look at birds.
> My dentist is such a person and he's travelled to various places around
> the world, like the Aleutian Islands and Siberia, to look at birds. I
> don't think he's ever done a criminal thing in his life. (Of course, he
> is not a character on a TV show either.)

IIRC, M*A*S*H's Fr. Mulcahy guested on MURDER, SHE WROTE. He ended up
being the killer and he was ... a bird watcher.

That's the only one that comes to mind for me, though.

--
Jim G. | A fan of the good and the bad, but not the mediocre
"Dang it. That was my best Dirty Harry. He might just be an idiot." -- Jason Stackhouse, TRUE BLOOD

David Johnston

7/26/2013 6:55:00 PM

0

On 7/26/2013 11:12 AM, Jim G. wrote:
> Rhino sent the following on Fri, 26 Jul 2013 12:43:42 -0400:
>> On 2013-07-26 1:25 AM, David Johnston wrote:
>>> They replaced the old junkie played by the guy from Republic of Doyle
>>> with a different guy and wedged him into the storyline by revealing he
>>> speaks German courtesy of having spend 5 years in German P.O.W. camps.
>>> So apparently there's a reason for him to be messed up.
>>>
>>> You know, I don't think I've ever seen a bird watcher on a cop show who
>>> wasn't a criminal.
>>
>> I can't imagine why a bird watcher would be more or less inclined to
>> criminality than anyone else.
>>
>> I don't think I've ever seen a bird watcher on a cop show.
>>
>> In fact, the only bird-related observations I have is that Robert Blake
>> had a parrot (or was it a cockatoo?) in Baretta which he seemed fond of.
>> (I think I only ever saw the pilot of that show; I was not a regular
>> watcher so I don't know if the bird lasted beyond the pilot.)
>>
>> In NYPD Blue, Jimmy Smits' character Bobby Simone had a friend named
>> Pete who kept pigeons on the roof of his apartment. That figured into an
>> episode or two. But I make a distinction between bird owners and bird
>> watchers. Naturally, a bird owner will observe his own birds but a real
>> bird watcher may travel hundreds or thousands of miles to look at birds.
>> My dentist is such a person and he's travelled to various places around
>> the world, like the Aleutian Islands and Siberia, to look at birds. I
>> don't think he's ever done a criminal thing in his life. (Of course, he
>> is not a character on a TV show either.)
>
> IIRC, M*A*S*H's Fr. Mulcahy guested on MURDER, SHE WROTE. He ended up
> being the killer and he was ... a bird watcher.
>
> That's the only one that comes to mind for me, though.
>

I've seen about 4 characters who were birdwatchers (or claimed to be) on
TV, and they were all murderers.