From: ideal one Date: 2011-08-13T06:55:53+09:00 Subject: Stuck at an Issue with OptParse and File IO 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") Below is part of the code that is throwing following exception fh = options.logfile.open('w') --> This line is failing log = TeeLogger.new(fh,$stderr) log.level = Logger::INFO log = TeeLogger.new(fh,$stderr) 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 `
': undefined method `logfile' for # (NoMethodError) -- Posted via http://www.ruby-forum.com/.