[header] How to build a gable roof [title] Nail top plates to all the outside walls. [step] The top plates should consist of 2 boards of sufficient width to cover the tops of the walls. [title] Measure and cut ceiling joists from 2-by-4 lumber. 
[step] You will attached these to each pair of rafters so they resist the outward pressure of the rafters on the walls. Install the ceiling joists onto the top plates so they span the structure from one long wall to the other.