Stef from Girl. Inspired. shows several ways to sew a ruffle. She shows how to make them using basting stitches (one row or two) and pulling the gathers by hand. She also shows how to make them using a special ruffle foot. And, for less precise applications, just using the tension and stitch length on your sewing machine (no special foot required) to gather up the fabric as you sew. Go to Girl. Inspired. to get her tutorial.
[photo from Girl. Inspired.]