I am trying to print elements in the array that add up to ten, but I get this error: 

```
 8 : 25 : 55 : 5TypeError: nil can't be coerced into Fixnum 

```

This is my code:

```
array =  [6, 2, 7, 1, 10, 9, 0, 8, 2, 10, 10, 3, 5, 7, 2, 5, 5, 5]
def print(array)
  array.each_with_index.inject(0) do |m,(roll,i)|
    if array[i] + array[i+1] == 10 
      print "#{array[i]} : #{array[i+1]}"
    end
  end
end

```

My desired output is:

```
8:2,5:5

```

How can I fix this?