Rangers are typically survivalists and typically alone or in small groups. When i think of a Ranger I think of Tolkenien meaning of Ranger. Someone who forsakes much of civilisation to live a life out in the wilds. Pets are optional, traps are necessary, they take every advantage to defeat stronger, faster and more ferocious beasts and all kinds of creatures.
It makes absolute sense that Rangers are more than able to wield melee weapons competently, because sometimes there are human adversaries such as bandits out in the wilds. Perhaps a spear for the reach or a simple sword? They must be nimble after all to escape immediate danger and damage.