?

Log in

No account? Create an account

GEEK: Notes on rubygem, pdb.set_trace() - Open Knowledge — LiveJournal

Nov. 27th, 2007

01:04 am - GEEK: Notes on rubygem, pdb.set_trace()

Previous Entry Share Next Entry

If you want to use a newly installed rubygems, and you don’t want to require ‘rubygems’ for every program that uses a gem, you need to set the RUBYOPT environment variable. For example, if you’re using tcsh, you should put the following in your .tcshrc file:

setenv RUBYOPT rubygems

This will cause the rubygems module to be loaded every time your run a ruby script.

——

If you call an external python script from within ruby, make sure you have any pdb.set_trace() lines commented out. When the ruby script tries to run the program, it will just hang at the point you set the trace, without giving you any output. For example, if test.py script has a pdb.set_trace() set, and you run the following command from within irb, the line will never finish executing. You’ll have to interrupt it with a CTRL-C command.

dfi_result = `/Users/build/crasch/PythonScripts/test.py -positions -total -infile /MData/Data/vyslf.csv -MStderrLoggingThreshold 3`

Original: craschworks - comments