how can a plastic ruler get a positive charge?

Rub it with cotton or fur. That removes electrons from the ruler, leaving a postive net charge.