Hi,
Below is part of the code that is throwing following exception
“:in <main>': undefined method
logfile’ for #OptionParser:0x2cace70
(NoMethodError)”
fh = options.logfile.open('w') --> This line is failing
log = TeeLogger.new(fh,$stderr)
log.level = Logger::INFO
log = TeeLogger.new(fh,$stderr)
pls help me resolve this issue
Cheers
On Aug 10, 2011, at 10:20 AM, ideal one wrote:
log = TeeLogger.new(fh,$stderr)
pls help me resolve this issue
Since you’re interacting with OptionParser, we’ll need to see how you
ran the script on the command line.
Regards,
Chris W.
http://www.twitter.com/cwgem
Chris W. wrote in post #1016012:
On Aug 10, 2011, at 10:20 AM, ideal one wrote:
log = TeeLogger.new(fh,$stderr)
pls help me resolve this issue
Since you’re interacting with OptionParser, we’ll need to see how you
ran the script on the command line.
Regards,
Chris W.
http://www.twitter.com/cwgem
Hi,
i am picking default values that i am using in optparser class,
something like this…
options.logfile = LOGFILE
options.results_dir = Pathname.new(ENV[‘TEMP’])
PROG = Pathname.new($0).basename
EFIX = PROG.sub(/..*$/,‘’)
LOGFILE = Pathname.new(“#{ENV[‘TEMP’]}/#{FPREFIX}.log”)
Im running it on eclipse and on also on cmd i get the same error…So
when i run=>
ruby opttest.rb
"C:/Users/user1/workspace/Test/opttest.rb:153:in <main>': undefined method
logfile’ for #OptionParser:0x2cace70 (NoMethodError)