Net/sftp problem

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:into
_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:inrespond_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:inwhen_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:incall’
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:inloop’
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:instart’
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

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.