Material does not apply to array
Use generated coords, drive the scale.

Nodes aren't particularly my strong point.  Looking at the question setup can make minor alterations to get the effect of gradient across array


change the texture to generated (modified)





and drive the scale with the array count of object.




The driver