Ruby分片读取文件有两个办法第一, 使用linux的split命令,分割文件,然后在逐个读取文件class File MEGABYTE = 300 * 1024 def each_chunk(chunk_size=MEGABYTE) yield read(chunk_size) until eof? endend