How to enter a remote directory on Ruby NET:SFTP?
问题 How to enter a directory like the command - cd, thus operate remote files without a path prefix ? Here is my current code. Net::SFTP.start do |sftp| sftp.rename!(REMOTE_PATH + "latest.zip", REMOTE_PATH + "latest.back.zip") sftp.upload!("latest.zip", REMOTE_PATH + "latest.zip") end I would like to have: sftp.cd REMOTE_PATH sftp.rename!("latest.zip", "latest.back.zip") sftp.upload!("latest.zip", "latest.zip") 回答1: I found a solution, which is use the SSH connect instead. . Not works. SFTP path