The Second Amendment does apply to knives. Know the knife laws in your state, and in other states you may find yourself in.
If personal protection is a priority for you, a knife is something that you can use right away, without having to identify yourself or register the weapon.
A knife is a very poor choice of self defense unless you are already very skilled at close quarters combat with a knife, and even then, it comes at extremely high personal risk, it should be a weapon of surprise that is an absolute last resort.
Pepper spray (if it is an option where you live) is a MUCH better first option for someone who may not be capable of fighting off an attacker, but being aware and cautious is the best way to avoid attacks.
There's no such thing as a perfect self defense tool. Every option will have it's best and worst-case scenario. Carrying everything you may need to defend yourself is unrealistic. Ultimately, what you carry is going to be a choice you need to make, based on what you feel capable of using and comfortable living with the consequences of.
Personally, I wouldn't recommend carrying pepper spray unless you're also carrying a more lethal option as a backup. Pepper spray doesn't always work, and has the potential to further escalate an already-escalated situation. It can be good for preventing an attack, but is next to useless if a fight has already started.
I'd argue it's a hell of a lot better than useless even after the fight starts (especially if it's unarmed), but would agree that spray is the compromise between a strong word and ending a life.