Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > net/sftp problem

Reply
Thread Tools

net/sftp problem

 
 
Damjan Rems
Guest
Posts: n/a
 
      09-23-2008

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', assword => '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/.

 
Reply With Quote
 
 
 
 
Damjan Rems
Guest
Posts: n/a
 
      09-23-2008

Nevermind. I found out that destination filename must be specified.

sftp.upload!('testSFTP.rb', '/home/rems/testSFTP.rb')


by
TheR


When nothing helps, read the documentation.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57