The Curve modifier requires some more detailed geometry to curve the cube - otherwise you still only have 8 vertices and 6 faces to spread over the cube. Fron your screenshot you do appear to have a Subdivision Surface modifier but it is after the curve - click the ‘up arrow’ in the top-right of the Subdivision Surface modifier panel to move it above the curve. You’ll then need to increase the View number of subdivisions - set it the same as Render (ie, 2). This will affect the shape of your cube as it will cause corners to be rounded off - so click Simple (which divides without affecting the overall shape) rather than Catmull-Clark (which divides and blends faces and edges into each other).
Increase the number of subdivisions (View and Render) for more detail along the curve.