Begin by removing as much surface material as you can. A spoon or dull knife works well for this. Do not scrub or rub too hard, as this may damage your carpet.
Apply rubbing alcohol to the stained area using a spray bottle. Blot gently at the area with a clean dry towel. Next, sponge warm water on to the area and blot dry with a clean towel. Try vacuuming the area, to see if the rubber stain has been loosened enough to disappear.
If not, mix up a solution of 1 tablespoon laundry detergent (non-bleach) and 2 cups warm water, gently sponge onto the stained area, and blot up with clean dry towels. You may need to repeat this process several times.
If both methods do not work, try applying a 3% hydrogen peroxide solution to the stain, and let it sit for 5 to 10 minutes before repeating the sponging and blotting process.