how to subtract arrays of integer in ruby : I have got four arrays of int in ruby: 
- num_defect[1..10]
- num_fixes[1..10]
- num_blocks[1..10]
- num_ext_defects[1..10]

For a reporting (using chartjs), I want to display the number of open defects, which is num_defects - num_fixes - num_blocks - num_ext_defects

I tried 

        num_defect.map { |i| i - num_fixes[i] - num_blocks[i] - num_ext_defects[i] }

but ruby does not like it "nil can't be coerced into Fixnum"

Any help greatly appreciated.

Bernhard