Apply .jpg image as a texture to a face

Seems I have to apply a colour first?

square = entities.add_face [[0,0,0],[50,0,0],[50,50,0],[0,50,0]]
square.material = Sketchup::Color.new 'Gray'
square.material.texture = 'C:\path_to_material\Corrogated_Iron.jpg'

This works fine, and with a lot less code?

However what is wrong with my last code? Because here: Adding Named Textures to Face; it seems like bartmandude had no troubles?