The rotting of wealth, he says, the eating of garments by moths, and the rust of silver and gold will testify against you, exposing you for having given nothing. Therefore in the last days, that is, at the coming of the Lord, your wealth will prove to be, as it were, fire gathered for your destruction, which the rich man mentioned in the Gospel also experienced.
This must be joined with the words "your riches," so that the speech reads as follows: "your riches, which you have heaped up like fire, and on earth have spent on pleasures and squandered."
Source: Commentary on James