You can only make some place so safe in a country like the US. It's trivial to obtain a firearm, so naturally gun violence will always be a problem for us.
To be fair, cities do also generally have MUCH more public services available. They have shelters, food banks, and free mental health facilities out the wazoo as compared to rural areas. But there's only so much you can do.