Open windows to increase air circulation. Place a fan in front of the window to pull out the air laden with gas smells from the room. Blot up the excess gasoline from the carpet with a white towel. Move from the outside in to prevent spreading the stain.
Dilute 2 tbsp. of dishwashing detergent in a quart of water. Dip a towel in the mixture and blot the stain. The dishwashing detergent's composition can break down the oil in the carpet fibers.
Sprinkle baking soda on the entire carpet and leave on for ten minutes. Vacuum the carpet. Follow the next step if the smell is still in the room.
Pour apple cider vinegar in a spray bottle and spray the entire carpet. Allow the apple cider to break down the smell of the room and vacuum in the morning.
Sprinkle coffee on the carpeting if you are working with a dark-colored carpet. Let the coffee sit on the carper overnight and vacuum in the morning.