Remove the roof's ridge caps with a flat pry bar. Read the ridge vent manufacturer's recommendations for the width of the roof opening. Mark the width on each side of the roof at both ends. Snap a chalk line on each side to the marks. Pry up all nails inside of the chalk line.
Set the blade depth of a circular saw to cut through the roof but not into the rafters. Start 1 foot from the roof edge and cut along the chalk line with the circular saw. Cut along the chalk lines and stop 1 foot from the edges of the roof on all sides.
Remove the cutout ridge with the pry bar. Measure half the width of the ridge vent down from the peak on both sides. Repeat on both ends of each side. Snap a chalk line on both sides by running the line between the marks on each end.
Roll the ridge vent over the length of the cutout so the ends touch the ends of the roof. Butt ends of vent together to lengthen it if needed.
Align the ridge vent so it sits evenly over the roof's ridge. Use the chalk lines as guides to align the sides of the vent. Attach the ridge to the roof by nailing roofing nails along the edges of the vent every 6 to 12 inches.
Cover the vent with cap shingles. Overlap each shingle and attach it to the roof with a 1½-inch roofing nail nailed into each end.