Self-organization of a laser-driven cold gas in a ring cavity