The ruler is an item that has no apparent application and appears in EarthBound, along with a similar item called the protractor, and in EarthBound Beginnings. The item serves no real purpose, and will only produce text stating that the user can "figure out the lengths of things easily". In EarthBound Beginnings, the item gives the description "It is 12 inches long".
In EarthBound, the ruler is found in Jeff's inventory when he first joins the party, and can be bought from a boy near the southwest end of the Burglin Park in Twoson for $2. The New Age Retro Hippie also uses one in battle to waste a turn, and may drop one when defeated. In the caves of Talah Rama is a Monkey which ask for a Ruler, and when you give it, she will move and let you progress further in the caves.
In EarthBound Beginnings, the ruler is found on the top level of the Department Store in Merrysville.