Question: How to suppress net-ssh warnings in JRuby?


How to suppress net-ssh warnings in JRuby?

Answers 2
Added at 2016-11-01 19:11

I am seeing ELF warning with net-ssh and I am trying to suppress that warning from printing it on console.

I tried mentioning $VERBOSE = nil before I create my ssh object but that did not help. I still see the warning messages on the console.

Later I tried to use Kernel.suppress_warnings but that seems to be Rails specific.

At last I tried to redirect the warning message to STDERR but that did not work either.

Any help in making this work is really appreciated. Thanks!

Below is the line that is generating warning message.

$SSH, @ssh = Net::SSH.start(@hostname, @username, :password => @password) if !host.nil?

nr: #1 dodano: 2016-11-01 23:11

From the source code it looks like you might need to set verbose to :silent rather than nil

nr: #2 dodano: 2016-11-03 17:11

System is not able to load the native C libraries. This can be fixed by using the following:

java -Djruby.native.verbose=true -Djava.library.path=/lib64 -jar ssh_test.jar
Source Show
◀ Wstecz