I am trying to transfer a file to remote server with net::sftp.
require 'rubygems'
require 'net/sftp'
Net::SFTP.start('192.168.1.111', 'rems', :password => 'mypwd') do
sftp>
sftp.upload!('testSFTP.rb', '/home/rems')
end
···
-----------------------
C:/RUBY/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/operations/upload.rb:
313:in `on_open': Net::SFTP::StatusException open /home/rems (4,
"failure") (Net
::SFTP::StatusException open /home/rems (4, "failure"))
from
C:/RUBY/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `to
_proc'
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/request.
rb:87:in `call'
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/request.
rb:87:in `respond_to'
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/session.
rb:947:in `dispatch_request'
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/session.
rb:910:in `when_channel_polled'
from
C:/RUBY/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `to
_proc'
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/connection
/channel.rb:311:in `call'
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/connection
/channel.rb:311:in `process'
... 26 levels...
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/session.
rb:801:in `loop'
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/session.
rb:786:in `connect!'
from
C:/RUBY/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp.rb:32:in
`start'
from testSFTP.rb:4
------------------------
Server is Ubuntu 8.04, net-sftp 2.0.1 (same on linux and windows).
Runing sftp from prompt allows me to put file on server.
sftp.download!('/home/rems/sometest', '/temp') works ok.
What am I missing?
by
TheR
--
Posted via http://www.ruby-forum.com/\.