1
我有一個rake任務,它設置爲使用nets/scp
gem從遠程服務器獲取文件夾。 我的Gemfile:Rails Net :: SCP文件傳輸
gem "net-ssh"
gem "net-scp"
我的代碼:
require 'net/scp'
desc "Fetch hadoop data"
task :fetch_data => :environment do
Net::SCP.download!("server_name", "user",
"/home/dashboard/data", "#{Rails.root}/lib/tasks",
:password => "password1")
end
我得到的錯誤:SCP did not finish successfully (1)
如何將文件夾保存到我的軌道任務目錄,我怎麼能打印出更關於什麼導致scp出錯的信息?另外,我有我id_rsa鑰匙保存在我知道