标签: ruby popen
我运行一个在stdout上返回长JSON的脚本,但显然它被截断了:
res = '' Open3.popen2('node script.js') {|i,o,t| while line = o.gets res = res + line end } puts res # it is truncated
为什么呢?我怎么能避免它?