Maintain your rib pattern regardless of where the CO stitches fall.
"I tried: Rib 4, then to cast off the 1 stitch, I knitted a stitch, then another and pulled one over the other..."
Yes. Assuming you are working a 2x2 rib this would have been...
k2 (CO1 and maintain the other as 1st stitch of next series)
then P2, K2, P2, k2 (you should have 9sts on needle since last CO)
P2 (CO1 and maintain the other as 1st stitch of next series)...
Just knit the knits and purl the purls as they appear. Make sure to work 2 sts before CO the one, and count the one remaining st as the start of your next series.