I apologize if this is not the right place to post a message about a gem
like Net::SFTP - if there is a more appropriate forum please let me
know.
When I try to connect to one SFTP server, everything works great. This
is the code:
require “net/sftp”
class TestSftp
Net::SFTP.start("", “”,
:password => “”)
do |sftp|
sftp.download!("",
“”)
end
end
However when trying to connect to a particular SFTP server, I receive
the following error message:
/var/lib/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/operations/download.rb:307:in
on_open': open <remotefile>: failure (4) (RuntimeError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
to_proc’
from
/var/lib/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/request.rb:87:in
call' from /var/lib/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/request.rb:87:in
respond_to’
from
/var/lib/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:947:in
dispatch_request' from /var/lib/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:910:in
when_channel_polled’
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
to_proc' from /var/lib/gems/1.8/gems/net-ssh-2.0.11/lib/net/ssh/connection/channel.rb:311:in
call’
from
/var/lib/gems/1.8/gems/net-ssh-2.0.11/lib/net/ssh/connection/channel.rb:311:in
process' ... 26 levels... from /var/lib/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:801:in
loop’
from
/var/lib/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:786:in
connect!' from /var/lib/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp.rb:32:in
start’
from testSftp.rb:12
Line 307 in download.rb looks like this:
raise “open #{entry.remote}: #{response}” unless response.ok?
However, I really don’t know what’s going on. One thing to note is that
I can sftp fine from the command line to this particular server - I’m
pretty sure it’s not an issue with my login credentials being correct.
I’m wondering if a different protocol is being used on this particular
server and and if Net::SFTP is having problems with that; or something
of this nature. Does anyone have any experience with this? Thanks.