Eating late at night won't cause you to gain weight. As long as you're not exceeding your calorie needs for the entire day, it won't affect the scale.