Everything is rendered black, when I set it to be a gradient
The gradient material isn't assigned to any of the cubes; they just have a default diffuse material:



To assign your gradient material to all of them:


Select all the cubes (I used border select (B) to do this)
Set the material of the active object in Properties > Materials
Press &#9096; CtrlL> Materials to link the active object's materials to the selected objects.