i would treat it like clothing...I would freeze it with ice cube and peel it off with razor blade or box cutter knife.
OR
WD-40 also works well to remove gum. Spray it onto the gum spot and smoosh it around a little bit. Let it sit for fifteen or twenty minutes and then remove. The gum will slide right off the carpet! It may take two applications, but the gum should come right out. Lighter fluid is also something you can use, which you wouldn’t expect. This is not recommended around fireplaces or where people are smoking (or anywhere else it might be exposed to heat or flames.) With these latter two methods, you’ll probably want to test a hidden area of your carpet first to be sure no damage will be incurred. After the gum is removed, clean out any residue or leftover product with a damp cloth.
OR
Warm vinegar might also work. Pour it directly onto the gum and let it sit for a while. Scrape off the gum with a butter knife and then wipe clean with a damp cloth. This method may take a few tries and require some heavy scrubbing but if one of the above methods isn’t available, you can give it a shot.
OR
An oil soap, such as one that cleans wood, will also help to remove gum. Pour it onto a cloth and rub into the gum. It may take a few tries, depending on how deep the gum is ground into the carpet, but the gum will come out if you persevere. Rinse with a damp cloth.
After the gum is removed, you may still have a stain on your carpet. If this is the case, put a bit of mild dish detergent or vinegar on a sponge or cloth and blot at the stain until it disappears. Then, blot with a clean damp cloth to rinse.