Arrayクラスのeach_consメソッドを使う
[1,2,3,4,5].each_cons(2).to_a #=> [[1, 2], [2, 3], [3, 4], [4, 5]]
[1,2,3,4,5].each_cons(2).map { |x, y| x + y } #=> [3, 5, 7, 9]
3つづつ欲しければeach_consに3を渡せばいい
[1,2,3,4,5].each_cons(3).to_a # => [[1, 2, 3], [2, 3, 4], [3, 4, 5]]