I am using a rails webapp and trying to send an xml file to a sftp server, using the following script:
Net::SSH.start(SFTP_HOST, sftp_user, {:port => SFTP_PORT, :password => sftp_password}) do |ssh|
ssh.sftp.connect do |sftp|
sftp.upload!( measurements_xml_file_path( meas ).to_s ) do |event, uploader, *args|
case even
when :open
puts "Starting upload"
when :finish
puts "Finished upload"
return true
end
end
end
Nevertheless, I am always get an error "Errno::ENOTTY ... Inappropriate ioctl for device"
. Any help how to fix this error?