I always work on my computers in the kitchen, since the rest of the place is carpeted. But if I'm forced to work on my computer where there is carpet, I just touch the metal chassis of the case for a minute or so to ground myself, before touching any of the other parts.
But what you can do is maybe, buy a rubber mat?