I've been reading Vakil's notes on Algebraic Geometry on locally ringed spaces and there's a part that confuses me. There's an exercise on page 135 that says that says that the stalk of an affine scheme Spec$R$ at $p$ is the local ring $R_p$. This is clear. What is not, is that a few lines later Vakil says that this shows that all schemes are locally ringed spaces. Could you please help me see it?
Perhaps this makes more clear what it is that confuses me. If $p \in X$ has two different affine neighborhoods then what would be the maximal ideal of the stalk?