If you're trying to make it in stockinette stitch (purl one row, knit the next) it will curl. The only thing to do is to make a border of garter stitch (knit every row) around it. First, make four rows of garter stitch, then on the next row knit 4, purl until 4 stitches before the end of row, then knit 4. Next row, knit whole row. Next row: Knit 4, purl, knit 4. Keep repeating these two rows until the scarf is the length you want, then do four more rows of garter stitch. Et voila!