To get the slack needed, manually push the rear derailer to a lower gear (towards the center of the wheel) while pedalling it by hand (or having someone else pedal it). Stop pedalling. There will be some tension on the derailer, but should provide enough slack to seat the housing in the cable stop. Also, be sure the shifter is in the highest gear (9 or 10, depending on what you have), that will also provide maximum slack available.