If you're using Strava with a smartphone, then it has to rely on map data to figure out your elevation, but if you go on overpasses or something that often doesn't show up. Also if there are elevation changes or unknown elevations between the mapped elevation levels you'll lose that gain in your summary as well. If you use a Garmin with an altimeter you'll get a more accurate reading.
I'm not sure ridewithgps works though.