Last active
February 10, 2020 18:10
-
-
Save divinediscipline/4b9e62342b956e406c57fa1e34d8252f to your computer and use it in GitHub Desktop.
sftp error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is in a different file | |
require 'net/ssh' | |
require 'net/sftp' | |
class Sequoia::Export | |
def self.send_missing_assignments_to_sequoia(file_path) | |
Net::SFTP.start('sftp.bsiwighft.com', 'hirekkllarhjgjtsftp', :password => 'ZjcH!gkbg09bKFvH') do |sftp| | |
# upload a file or directory to the remote host | |
debugger | |
sftp.upload!(file_path, "/incoming") | |
end | |
end | |
end | |
# This is also in another different file | |
file_path = Rails.root.join('tmp', "hireart_sequoia_sftp_export_#{Time.now}.csv") | |
# assignments_to_be_sent_to_sequoia is an active record relation which is converted to a csv file using a to_csv method in my code | |
csv = assignments_to_be_sent_to_sequoia.to_csv | |
File.open(file_path, 'w') { |f| f.write csv } | |
Sequoia::Export.send_missing_assignments_to_sequoia(file_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes. I'm very certain.
Was able to send a test readme at the root of my project this way:
sftp.upload!('README')