I feel your pain
Having a Yarn Jedi for a girlfriend, I knew this was a characteristic of stockinette, but figured ribbing would get me around it. So for my first scarf project I made 60 inches of k4-p2 and STILL... the ends weren't curling up, but the sides? Well... at the edges ribbing is still stockinette in its heart and soul. File that one under Notes to Self.
So what to do about it? (After the fact, that is.)
Option 1: Deal with it. Yeah, could do that but it's not optimal.
Option 2: Frog it all and start over. Yeah right.
Option 3: Be extra nice to aforementioned Yarn Jedi girlfriend and ask if she'll crochet an edge down both sides. (I'm a COMPLETE disaster with a crochet hook... a regular menace in fact. Fortunately Mistress Yoda is totally cool with bailing me out.)
Option 4: (Since December is the busiest time of year imaginable for a Yarn Jedi) Pick up a bazillion stitches along each edge and knit a row or two of something (that's NOT stockinette) perpendicular to the ribbing. (Up side, no need to trouble Yoda. Down side, scarf is now officially and totally non-reversible.)
Option 4.1: Learn to crochet. At least enough to manage this job.
Obviously this hasn't been a high-priority issue since I finished the scarf back in ... May(?), and it's now December, so perhaps Option 1 was more workable than I thought.