I think the solution (for schools, anyway) would be adult-led structured activities where intelligence and hard work are rewarded: electronics/robotics/programming clubs, with long-term group projects where people with varied levels of experience can be accommodated.
I'd naively like to believe that gender can be left out of it, other than making a structured effort to recruit students irrespective of gender.