A natural follow-up to your question might be: "If everything is expanding, then wouldn't the ruler itself be expanding, so the expansion becomes unobservable?"
I'm not a physicist, but from my understanding, the situation is a bit more complicated than the phrasing in your question suggests.
Observation #1: The light from far-away galaxies is redshifted (spectral lines are a bit off from where we'd expect them to be). This suggests that these galaxies are moving away from us. The farther away the galaxy, the more it is redshifted. This suggests that the farther away the galaxy, the faster it is moving. Observations indicate that the recession speed is directly proportional to distance.
This observation is consistent with general relativity, which suggests an expanding universe with homogeneous mass.
But on a smaller scale, gravitational binding somehow takes over, and on even smaller scale, things like electromagnetic and nuclear interactions start having a greater impact, and that's why the Milky Way isn't itself expanding. For that matter, even Andromeda (0.8 Mpc) is too close to be affected by Hubble-style expansion, which only becomes observable at the multi-megaparsec scale.
I'm not a physicist, but from my understanding, the situation is a bit more complicated than the phrasing in your question suggests.
Observation #1: The light from far-away galaxies is redshifted (spectral lines are a bit off from where we'd expect them to be). This suggests that these galaxies are moving away from us. The farther away the galaxy, the more it is redshifted. This suggests that the farther away the galaxy, the faster it is moving. Observations indicate that the recession speed is directly proportional to distance.
This observation is consistent with general relativity, which suggests an expanding universe with homogeneous mass.
But on a smaller scale, gravitational binding somehow takes over, and on even smaller scale, things like electromagnetic and nuclear interactions start having a greater impact, and that's why the Milky Way isn't itself expanding. For that matter, even Andromeda (0.8 Mpc) is too close to be affected by Hubble-style expansion, which only becomes observable at the multi-megaparsec scale.