A knife is useful but not for self-defense. The spray seems a better idea, although my wife and I have never carried it. In addition, you might consider carrying a whistle.
Some courses or workshops can also be good preparation: not only self-defense, but perhaps also first aid and/or bicycle repair. Such things can make you more confident on the road.