Between the two, I might go with the knife in most situations. I can't carry my hunting rifle around with me all day. Mine also has a huge scope on it that makes it useless at the distances you would typically encounter a hostile human attacker. The rifle is also overpowered for the job, and introduces concern for damage to unintended targets.
Have you ever heard the saying "in a knife fight, the difference between the loser and the winner is that the winner gets to go to the hospital"? Doesn't seem like a fun situation to be in. Especially for people who hunt with weaker calibers or lower powered scopes, it seems ideal to stay out of arm's reach from any potential bad guy