Since the number of nail boxes is 6 less than the number of yards of wood, the right expression to use is x-6. (x being the number of yards of wood)
Now let us calculate the number of nail boxes she bought.
Cost of x yards of wood at $27 per yard = 27x.
Cost of x-6 boxes of nails at $4 per box = 4(x-6) = 4x - 24
Therefore 27x +4x - 24 = 193
31x -24 = 193
31x = 193 + 24
31x = 217
x = 217/31
= 7
So she bought 7 yards of wood and 7-6 boxes of nail. That is, she bought only one box of nail.