When a cat rubs her anal area along the carpet, it is called "scooting" and it indicates that there is discomfort or irritation in that area. There are a number of possible reasons for this. The top ones that I would consider are:
1. Impacted anal sacs. The anal sacs (or anal glands) are little glands located at the 4 o'clock and 8 o'clock position around the anus if you are standing behind your cat. They are normally about the size of a green pea in a cat. They have a little tube leading from the anal sac to the anal opening, and what Mother Nature intended was that every time your cat defecates, a few drops of the fluid contained in these sacs gets deposited on the feces.
Sometimes, however, the little tube gets blocked and the anal sac cannot empty. Anal sac fluid is continuously produced by the body so the sac gets more and more full. This causes a great deal of discomfort and the cat will rub her anal area along the carpet in an effort to empty these sacs. If they don't empty, they will keep getting more full and eventually they can rupture out through the skin.
Given how close the area is to fecal matter, anal sac ruptures seem to always get infected. Treatment requires oral antibiotics since the sac is under the skin and the only way to get the antibiotics to it is by the blood stream.
Here are some links to further information:
2. Intestinal parasites - Tapeworms and whipworms can cause anal irritation. These are not likely if your cat is indoors only. A fresh fecal sample will allow a vet to determine if this is the cause of your cat's behaviour.
3. Flea bites - Fleas like to live around the tail area because it is hard for the cat to groom there and get them off. If your cat is chewing and biting in the tail area, look through her fur for fleas or flea dirt (which looks like pepper). Again, if your cat is indoors only this is less likely.
Of these 3 problems, anal sac impaction is the one that I most commonly find in scooting cats. For this, you could try to help her feel more comfortable by washing the anal area with a warm, damp cloth and a drop of a gentle soap. Scrub the area well, then rinse and pat dry (if she will let you!). This may help to loosen a hard "plug" that may be blocking the anal duct. If she is still scooting tomorrow, I would suggest you take her in to see your vet to have her anal glands checked and emptied.
I hope that helps you. If this has been helpful, please "Accept" my answer, and leave feedback. I will still be here if you have further questions!