How do I repair a curtain rod anchor that was ripped out of the wall?
There's several ways to fix this, depending on a few things.

The best thing to do is avoid drywall anchors, and screw directly into a stud. If there's one close enough that it looks okay, you should do that. You'll have to patch up these holes, which may be a bit of a pain to do with the textured walls, but it's doable.



The next best option is probably to use a toggle bolt anchor. These are bolts that expand when you put them in the wall:



This site has some good info on them, including a sizing chart:

Toggle Size  Drill Bit Needed

1/8" toggle   3/8" drill
3/16" toggle  1/2" drill
1/4" toggle   5/8" drill
5/16" toggle  7/8" drill
3/8" toggle   7/8 drill
1/2" toggle   1 1/4" drill


This option has the advantage that you can probably use the existing holes (just use a large enough toggle bolt), and bolts are reasonably strong so hopefully this won't happen again. 

It's hard to tell from the picture, but if the curtain hardware doesn't totally cover the holes you'll need to do some cosmetic work. Keep in mind though that if you patch these holes with compound, they still won't be as strong as regular drywall, so you won't be able to put the same size anchor back in and expect it to hold.