Sabatier reaction oxygen to methane ratio for Mars ascent propellant

The Sabatier reaction is as follows:

$$\mathrm{CO_2 + 4\: H_2 \rightarrow CH_4 + 2\: H_2O}.$$

If water is electrolysed

$$\mathrm{2\:H_2O \rightarrow 2\: H_2 + O_2}$$

the global reaction becomes

$$\mathrm{CO_2 + 2\:H_2 \rightarrow CH_4 + O_2}.$$

Now, this gives an oxygen to methane ratio of 1:1 but both this site and this article state that the ratio is 4:1. Can someone explain what's missing?

It's a 4:1 ratio by mass. One molecule of methane masses 16 daltons, whereas one of dioxygen ($$O_2$$) masses 32, so two molecules of oxygen massed four times as as much as one of methane.
In practice, what you do is actually you start out with water to generate the $$\mathrm{H_2}$$, rather than just electrolysing the water that comes out in the end. (Well, you'd probably do that to, you'd feed it back into the start.) I.e. $$\mathrm{CO_2 + 2\:H_2O \to CH_4 + 2\:O_2}$$
That still gives only a 2:1 ratio of $$\mathrm{O_2}$$ to $$\mathrm{CH_4}$$. What the article means by “ratio of 4:1 of oxygen to methane” must therefore be the ratio of oxygen atoms to carbon atoms.