Your gap is caused from: Typical:
You have Rough framing that is done when the structure is being erected. This is all the Basic Framing .
which included the Roof sheathing(wood). Typical: The Finish Carpentry or Detail work is done as one of the last items. This is where Fascia and soffit and Trim
details come to play. Sometimes the Decking is not extended to the ends of the rafters. The The Fascia is installed to the ends of the rafters. Thus a gap appears. This typically happened in older homes.
You should have Drip edge metal installed to assist in keeping the water run off from coming into the walls. This is less time consuming and cost effective.
Otherwise- shingles would have to be removed , the gap fixed. , shingles reinstalled, More Time and cost involved.