It looks like you are trying to ssh using key authentication.. Can
you confirm this works via the command line without a prompt? I''m
guessing it''s asking for a password and failing (being a web app)
- Josh
On 29 Aug 2007, at 20:10, Andy Koch wrote:
> Hi,
>
> I''m having an issue where net::ssh (v. 1.1.2) is throwing ...
>
> private method `chomp'' called for nil:NilClass
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/util/
> prompter.rb:43:in `password''
>
> more comletely...
>
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/util/
> prompter.rb:43:in `password''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> methods/services.rb:56:in `register_services''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> methods/services.rb:53:in `each''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> methods/services.rb:53:in `register_services''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> methods/keyboard-interactive.rb:86:in `call''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> methods/keyboard-interactive.rb:86:in `authenticate''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> methods/keyboard-interactive.rb:65:in `loop''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> methods/keyboard-interactive.rb:65:in `authenticate''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> driver.rb:169:in `authenticate''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> driver.rb:155:in `each''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/userauth/
> driver.rb:155:in `authenticate''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/session.rb:
> 134:in `initialize''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh.rb:47:in
`new''
> /usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh.rb:47:in
`start''
>
>
> However, this doesn''t happen consistently so I''m left
scratching my
> head
> as to what the issue is.
>
> My code is as follows (from a Rails app)...
> **********************************
> def show_branch_backups
> @branch_option = BranchOption.find_by_branch_name(params[:id])
>
> bu_file_list = nil
> # get list of backup files on external server
> Net::SSH.start(HOST_URL, USER) do |session|
> shell = session.shell.sync
> cmd = shell.ls " -1t
> #{REMOTE_FILE_PREFIX}#{@branch_option.branch_name}#
> {REMOTE_FILE_SUFFIX}*.bz2"
> bu_file_list = cmd.stdout.split("\n").collect{|f|
> f.gsub("#{REMOTE_FILE_PREFIX}#{@branch_option.branch_name}#
> {REMOTE_FILE_SUFFIX}",
> '''')}
> end
>
> render(:partial => ''show_branch_backups'', :locals
=> {:bu_files =>
> bu_file_list})
> end
> **********************************
>
> As you can see, I''m merely getting a list of bzip files for
display to
> the user. On my dev machine I have Ruby 1.8.6 (debian), on the prod
> server I have Ruby 1.8.5 (also deb).
>
> On my dev server I never get this error and the only difference
> between
> the two, that I''ve noticed, is the Ruby version.
>
> Thus I wonder if the Ruby version could be the issue?
>
>
> --
> Andy Koch, Web Applications Developer
>
>
> _______________________________________________
> Net-ssh-users mailing list
> Net-ssh-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/net-ssh-users