Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby SSH gem非交互式无效选项?_Ruby_Ssh - Fatal编程技术网

Ruby SSH gem非交互式无效选项?

Ruby SSH gem非交互式无效选项?,ruby,ssh,Ruby,Ssh,我有如下Ruby代码: def make_ssh user, pass begin Net::SSH.start(@host, user, :password => pass, :non_interactive => true) do |session| @ssh = session puts @ssh end rescue Exception => e puts e end end 在Net::SSH库中,:non

我有如下Ruby代码:

def make_ssh user, pass
  begin
    Net::SSH.start(@host, user, :password => pass, :non_interactive => true) do |session|
      @ssh = session
      puts @ssh
    end
  rescue Exception => e
    puts e
  end
end
在Net::SSH库中,
:non_interactive
命令应该否定密码提示(我假设使用key/value
:password=>pass
进行身份验证),但每次尝试运行代码时,都会出现“invalid option”错误

我已经尝试过使用ssh块和不使用ssh块,以及

Net::SSH.start(@host, user, {:password => pass, :non_interactive => true})

但似乎什么都不管用。我做错了什么?

我得到了和你一样的厄洛尔。此选项添加在net ssh 2.10.0中。您可能正在使用较低版本