May I ask what city? We have a trail in Oshawa that is frequented by homeless and drug addicts, and a few times I've been run at by one person in particular ( this guy also made attempts to stop my son and a friend of his in separate incidents, and they're in their 20s), and also a few small groups have purposely blocked the trail as I approached.
They never got me, but I swore if it ever happened again, I would get one of those retractable batons.
The unfortunate thing is that this trail is a major connection between the waterfront and the city, and there really aren't any other safe ways around it unless I want to contend with high-speed traffic.
So I can certainly empathize, it really is a shame that it came down to that for you. I would suggest still using it, perhaps not in that same area, but to do errands or other recreational rides, just to get more comfortable. Some people suck, but don't let that spoil a good thing.