Firstly it is pertinent to know that, Electric force are due to the movement of electrons that is due to its gain and loss. This phenomenon is based on static electricity.
When the glass ruler is rubbed over the woolen sweater, the wool gets positively charged and the ruler gains electron to form negative charge.
Now if this charged is not earthed, the negative charged ruler attracts the uncharged bits of paper, as a result of which the paper gets attached to the ruler.