Is it safe to clean contacts with an eraser?
It all depends on what you mean with safe.
To cut it short: if what you are doing is some sort of professional work, the answer is not at all. As @Jodes said in a comment, the right thing to do is to use some specialty chemical made for the job.
If, however, you are doing some hobbyist work and you are going to take some risks then your approach may work, but keep in mind that the results may not be very repeatable.
There are at least two things that may go wrong with your approach:
- Electrostatic discharge (ESD) issues
- Mechanical stress
Anytime you rub two objects against each other you have the chance of generating static electric charges on them. This phenomenon is called triboelectric effect. A problem with ESD is that it may not kill your chips rightaway (many chips today have protection circuitry that will handle a small amount of ESD), but it may degrade the performance of your devices (e.g. leakage currents or offset voltages may become permanently worse because of microscopic damages inside the semiconductor device). Therefore a RAM module, to take your example, may still work, but with intermittent failures or glitches (e.g. it may exhibit a higher error rate or it may work reliably only well below its rated maximum speed).
Whether your approach will work consistently in this respect will depend, besides sheer luck, on many parameters like ambient humidity, eraser and PCB materials, operator grounding, etc.
Mechanical stress is maybe a lesser concern, but it should be taken into account: if the eraser is hard, if you press too much while erasing, if the PCB tracks or pads are too thin, you may risk detaching one of these latter from the PCB and this will ruin your day most likely (repairing a multilayer PCB is not easy, is often expensive and sometimes is not even possible).
Short answer: no point.
Longer answer: In the past many generic and certain purpose made erasers have been used to clean electrical contact (diamond coated plastic sheets were used on relay contacts at times).
That said the cleaning is intended to remove oxide layers and gold plated contacts should not have oxidation. Also the gold plating on modern contacts is as thin as they can make it and heavy mechanical abrasion will remove some of the gold. When the gold is no longer protecting the base metal beneath you will have oxides forming.
The binders of an eraser are no conductive, this is good and bad, good because the fine dust should not cause a short but bad because any residue left will form an insulating layer. Any hard abrasive particles on the contact surface will prevent contact unless they are displaced when the contact is remade.
For gold contacts I would clean with solvent, 90+% ethyl or iso-propyl alcohol are safe for most electronic devices (careful with keyboards, switches and relays and other devices with exposed contacts that may get dirt washed in or displays and sensors that may use adhesives in construction). The solvent cleaning is also a good idea after cleaning with an eraser to remove the binder residue. Limit eraser cleaning of gold contacts to a very limited number of occasions and only if there is visible contamination that does not want to come off with the solvent.
There are aerosol contact cleaners that contain various solvents that are available for more money than they are worth.
Here are some mechanical contact cleaning aids
http://www.eraser.com/fybrglass-brushes-and-erasers/
@Lorenzo Donati alredy gave a good answer. But also be aware that there are several types of erasers.
This soft, beige-colored erasers made of pure natural rubber only will not do any physical damage to your PCBs (except when you apply too much force)
But often, some abrasive material like pumice or quartz is added. For example, this common type of eraser contains some abrasive material in the red part and a lot in the blue, used to remove Indian ink.
Also, the rubbers of pencils usually contain some abrasive material.
While a slight grinding effect may be intended to remove oxides, you can easily remove too much, e.g. from the gold plating of the contacts. The contact will corrode very fast making it very unreliable.