debugging question

E

eggman2001

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?
 
R

Roger Pack

maybe first
require 'rubygems'
then require the file,
maybe run it from within that directory.
maybe do Dir.chdir to it, first, then require.
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"?
 
E

eggman2001

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

Roger Pack

eggman2001 said:
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
 
E

eggman2001

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>
 
R

Roger Pack

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

eggman2001

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

Roger Pack

eggman2001 said:
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
 
E

eggman2001

That worked! Thanks so much :)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,269
Messages
2,571,338
Members
48,025
Latest member
Rigor4

Latest Threads

Top