You use a “[surface plate](https://en.m.wikipedia.org/wiki/Surface_plate)”. It’s a property of surfaces getting rubbed together consecutively that the only way you can get a common plane between 3 surfaces is to have one that is essentially perfectly flat.
So you start with nothing, then you rub two mostly flat rocks together, then you rub a third flat rock on the first one, then you rub the second and third ones together, and then you rub the first and second together again, repeating over and over, and eventually, you end up with a perfectly flat surface.
You can then use that to define the line along which you make your ruler.
Latest Answers