Hi,
I'm new to Ruby. I'd like to debug my wxruby applications (in Windows
XP). What's the best way to do this? I tried putting in 'print'
statements and hoping to get some output on the command window. I
invoke the ruby application by typing 'rubyw ttc.rbw' in the command
window, which of course, does not work. I also tried 'ruby ttc.rbw'
but I get:
app.rbw:3:in `require': No such file to load -- wxruby (LoadError)
from app.rbw:3
I'd very much appreciate some hints.
Many thanks,
RC
R. Cheung wrote:
Hi,
I'm new to Ruby. I'd like to debug my wxruby applications (in Windows
XP). What's the best way to do this? I tried putting in 'print'
statements and hoping to get some output on the command window. I
invoke the ruby application by typing 'rubyw ttc.rbw' in the command
window, which of course, does not work. I also tried 'ruby ttc.rbw'
but I get:
app.rbw:3:in `require': No such file to load -- wxruby (LoadError)
from app.rbw:3
I'd very much appreciate some hints.
Do you have wxruby installed? You can download the latest windows installer from here:
http://rubyforge.org/frs/?group_id=35
HTH,
Zach
Zach Dennis <zdennis@mktec.com> wrote in message news:<4149A41C.8020203@mktec.com>...
R. Cheung wrote:
>Hi,
>
>I'm new to Ruby. I'd like to debug my wxruby applications (in Windows
>XP). What's the best way to do this? I tried putting in 'print'
>statements and hoping to get some output on the command window. I
>invoke the ruby application by typing 'rubyw ttc.rbw' in the command
>window, which of course, does not work. I also tried 'ruby ttc.rbw'
>but I get:
>
> app.rbw:3:in `require': No such file to load -- wxruby (LoadError)
> from app.rbw:3
>
>I'd very much appreciate some hints.
>
>
>
Do you have wxruby installed? You can download the latest windows
installer from here:
http://rubyforge.org/frs/?group_id=35
HTH,
Zach
Hi,
Yes, I've installed both ruby and wxruby. The problem I have is that
if the app fails to start, it is sometimes due to syntax errors and
sometimes due to runtime errors (e.g. a nil member variable, etc.).
Without a DOS/Command window, firstly, I've no idea if it's a syntax
error, secondly, even if it does start, I can't use 'print' to print
out debugging statements to help me find out where I got to and what
went wrong (OK, I can open an auxilliary window and write to that, but
I could lose that window if the app dies). How do you experts debug
wxruby apps? Any help would be appreciated.
Thanks again,
RC
From: R. Cheung [mailto:cheungr@ecid.cig.mot.com]
Yes, I've installed both ruby and wxruby. The problem I have is that
if the app fails to start, it is sometimes due to syntax errors and
sometimes due to runtime errors (e.g. a nil member variable, etc.).
Without a DOS/Command window, firstly, I've no idea if it's a syntax
error, secondly, even if it does start, I can't use 'print' to print
out debugging statements to help me find out where I got to and what
went wrong (OK, I can open an auxilliary window and write to that, but
I could lose that window if the app dies). How do you experts debug
wxruby apps? Any help would be appreciated.
Rename the file from *.rbw to *.rb, as rubyw.exe will cause ugly segfaults
if anything in it tries to write to stdout. Then run the file from the
command prompt with ruby <prog>.rb. Then you can put print statements in to
your hearts content for debugging.
David
http://homepages.ihug.com.au/~naseby/
Hello R.,
Zach Dennis <zdennis@mktec.com> wrote in message
news:<4149A41C.8020203@mktec.com>...
R. Cheung wrote:
>Hi,
>
>I'm new to Ruby. I'd like to debug my wxruby applications (in Windows
>XP). What's the best way to do this? I tried putting in 'print'
>statements and hoping to get some output on the command window. I
>invoke the ruby application by typing 'rubyw ttc.rbw' in the command
>window, which of course, does not work. I also tried 'ruby ttc.rbw'
>but I get:
>
> app.rbw:3:in `require': No such file to load -- wxruby (LoadError)
> from app.rbw:3
>
>I'd very much appreciate some hints.
>
>
>
Do you have wxruby installed? You can download the latest windows
installer from here:
http://rubyforge.org/frs/?group_id=35
HTH,
Zach
Hi,
Yes, I've installed both ruby and wxruby. The problem I have is that
if the app fails to start, it is sometimes due to syntax errors and
sometimes due to runtime errors (e.g. a nil member variable, etc.).
Without a DOS/Command window, firstly, I've no idea if it's a syntax
error, secondly, even if it does start, I can't use 'print' to print
out debugging statements to help me find out where I got to and what
went wrong (OK, I can open an auxilliary window and write to that, but
I could lose that window if the app dies). How do you experts debug
wxruby apps? Any help would be appreciated.
Maybe you want to try Arachno Ruby. It works perfectly with wxRuby.
You can download it from www.ruby-ide.com
···
--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's
Ok, you've inspired me 
http://www.rubygarden.org/ruby?CustomCmdPrompt
···
On Fri, 17 Sep 2004 16:24:48 +0900, R. Cheung <cheungr@ecid.cig.mot.com> wrote:
Yes, I've installed both ruby and wxruby. The problem I have is that
if the app fails to start, it is sometimes due to syntax errors and
sometimes due to runtime errors (e.g. a nil member variable, etc.).
Without a DOS/Command window, firstly, I've no idea if it's a syntax
error, secondly, even if it does start, I can't use 'print' to print
out debugging statements to help me find out where I got to and what
went wrong (OK, I can open an auxilliary window and write to that, but
I could lose that window if the app dies). How do you experts debug
wxruby apps? Any help would be appreciated.
--
Bill Guindon (aka aGorilla)
R. Cheung wrote:
Hi,
Yes, I've installed both ruby and wxruby. The problem I have is that
if the app fails to start, it is sometimes due to syntax errors and
sometimes due to runtime errors (e.g. a nil member variable, etc.).
Without a DOS/Command window, firstly, I've no idea if it's a syntax
error, secondly, even if it does start, I can't use 'print' to print
out debugging statements to help me find out where I got to and what
went wrong (OK, I can open an auxilliary window and write to that, but
I could lose that window if the app dies). How do you experts debug
wxruby apps? Any help would be appreciated.
Have you tried to use a logger?
require 'logger'
$log = Logger.new( 'logfile.log' )
$log.level = Logger::DEBUG
# Now place logging calls in your code
$log.debug( "Haven't crashed yet! Good." )
I think the line number shows up someplace in each log-line prefix, but a quick hack if you're simply trying to trace key points is to use
$log.debug( __LINE__ ) # DELETE_ME
Easy to cut and paste through out code; easy to find and delete. Easy to read the line number.
James