Yes, there is a trick to ribbing.
I'll bet I know what you are doing wrong because I did the same thing when I was learning ribbing. You know how to knit, but probably haven't thought much about the fact that the yarn is always behind the left needle when you knit. And the yarn is in front of the left needle when you purl. It is important that you move the yarn into the correct position for each stitch, always between the needle tips. So yarn back, k2, move the yarn forward, p2, move the yarn back k2, etc.
The other thing is to be sure that all the stitches that look like knits (when they are facing you to be worked) are knit, and all the stitches that look like purls (have the bump right under the left needle), are purled.