如何使用 Ruby 通过 HTTP 下载文件?
可能是下载文件的最短方法:
require 'open-uri' download = open('http://example.com/download.pdf') IO.copy_stream(download, '~/my_file.pdf')