Net/ssh makes log4r fail

HI all,
For following code snippet, I get following error

$ ruby log4rtest.rb
/usr/lib/ruby/gems/1.8/gems/log4r-1.0.5/src/log4r/logger.rb:109:in
outputters=': undefined methodclear’ for nil:NilClass (NoMethodError)
from ax.rb:7

I get similar error on windows, thought not exactly same.
D:\Temp>ruby log4rtest.rb
log4rtest.rb:10: undefined method `outputters=’ for #Logger:0x2d46e88
(NoMethodError)

However, If I remove require ‘net/ssh’, the error goes away.
I am not sure in what way requiring net/ssh affect log4r
functionality.

Any ideas.
Thanks,
Manish

===================
require ‘rubygems’
require ‘log4r’
include Log4r
require ‘net/ssh’

$logger = Logger.new ‘log4GS_Host’
$logger.outputters = Outputter.stdout

Now we can log.

def do_log(log)
$logger.debug “This is a message with level DEBUG”
end
do_log($logger)

Hi, I’m having the same trouble. Have you already solved it?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs