I need a little help....

I am in need of some help as to what to eat before and during rides that will help me make it thru a 40-50 mile ride with out having a hypoglycemic moment.

This is my concern, how do I eat enough to last a ride and yet do not eat more then needed and gain weight.

if any of you have hypoglycemia and can give some helpful advice I would appreciate it.