Assuming your code goes before the face is made
mat1 = mats.add("Wood_Plywood_Knots")
makes a new material named "Wood_Plywood_Knots".
It will be 'black' [0,0,0] with NO texture as you haven't [yet] specified a color or a texture-image...
If that material already exists it gets a numeral suffix...
If you haven't defined 'mat1' when you assign it to the face it's like writing face.material=nil which is saying use the default front_face_material, which it already has! OR it cause a crash - what's in the Ruby Console...
Ensure a material is made before you use it...
IF you were to read/understand my earlier notes... they explain step by step how to make/use a material, give it a color and give it a texture [image-file]; then adjust that texture-image and match the material's color to it etc...