Ah... i think i see what it is. When you turn the work over, you have to remember you're doing the opposite. The stitches you knit on the one side, you have to purl on the opposite side. And vice-versa. Do you have an even number of ribs, so you start each row with a knit rib and end with a purl rib?
If you have an odd number of ribs, you must start and finish with knit ribs on one side, and start and finish with perl ribs on the other side. Amy has a video about ribbing, which tells you how to recognize what kind of stitch was done on the previous row.