Just as 'Billy' says. To say it another way, the frost is from warm, moist air condensing and FREEZING on the underside of the roof (which is a cold surface.) If you can seal off ANY source of warm, moist air (such as your vent), you'll know if it was the 'cause' of the frost. If you seal off the vent AND you still get frost, the 'leak' is from some other source.
Be sure your soffit vents aren't covered with insulation. Be sure your 'rafter cavities' (or chutes) aren't obstructed with boxes and stuff, and that there's a CLEAR path for air to rise up under the roof's sheathing to the ridge vent. (The ridge vent, which I might add, should be free and clear of debis. If you can see outside through it, you're OK.) You didn't say what you had for insulation, exactly. If it's blown cellulose, how thick is it? If it's fiberglass, what R-factor is it? In short, if the insulation is inadequate, you'll obviously need more.