I've cycled a fair few long-distance rides in my lifetime, and feel like I've built up a good profile of my nutritional needs. If you're planning a long-distance ride for the first time (four hours or more) or just struggle to get your nutrition right, my notes here may help. Do bear in mind though that everyone is different and with particular physiological needs, so you need to take my thoughts and figure out what's right for you.
I concentrate on three basic types of nutrition: water; complex carbohydrates; electrolytes. The carbs will typically be found in bananas, energy bars and carb powder (for the drink bottle), and the electrolytes will appear in energy gels and tablets (for the drink bottle).
You don't need to eat as much as you might think, and certainly not as much as is recommended on the energy gels. For a ride up to five hours, I'll typically have a banana around half way, and a gel around an hour from the end if I'm feeling empty. Much more importantly is how much I drink. The industry-standard recommendation is one 500mL bottle per hour, and is probably a good target to aim for. I will usually consume around 300mL per hour, and never feel like that's quite enough. I used to add quite a lot of complex carbohydrate powder to my bottles, but more recently I've changed to just adding an electrolyte tablet - and think that's a good thing. Keeping hydrated is the number one priority, and taking food on board is much less important. I've had my fair share of bonking experiences - also known as "hitting the wall", and can confidently attribute that to running out of fluids.
Another thing to bear in mind with food is that digestion does use up energy and water, so if you're eating more then you'll need to drink more too. I prefer to keep food intake to a bare minimum, so that I can put more of my energy into cycling!
Note that I'm a very lean rider (1.8m tall, weighing 65kg) so it's not like I'm carrying a lot of spare "fuel" in my body. If you're of a large build, and especially if you've taken up cycling in order to lost weight, then you should really try to limit your calorific intake during the ride.
The weather can obviously play a part - but only with fluid intakes! Perspiration will be a lot higher on a hot, sunny day, and I'll be drinking much more to compensate. On really hot days I'll even be forced to stop and buy some water, to replace my dwindling bottle supplies.
For me, it can be all too easy to delay on-bike nutrition until I'm starting to suffer. For other people, it may be the other way round, where they start drinking and eating as soon as they start moving. There's a sensible middle ground here: as long as you're well fed and hydrated at the start of a ride, you shouldn't need to take anything in for the first hour. Don't leave it much longer though, before taking on fluids, and try to establish a bit of a routine so that you (a) don't forget until you're dehydrated and achy, (b) aren't guzzling every few minutes. I try to down a big swig of drink every 15 minutes or so, and that way I'll be taking enough in without over-doing it.
If you don't like constantly reaching down for a bottle, another thing to try is a bladder. This is a flexible pouch, usually up to 1.5L capacity, that you strap to your back. You feed from it using a flexible hose that dangles near your mouth. With all of this under your lycra jersey there's very little effect on aerodynamics, and it's just a bit of faff beforehand getting things positioned right. I've used a bladder a few times (admittedly only for time trialling) and found it extremely convenient.
Not having eaten much during the ride, I'll usually get home and pretty much eat continuously for the rest of the day - or at least that's how it feels! My view is that this is the time to spoil myself, to make up for those hours of energy debt.
I've been doing this stuff for a while, but am no expert or professional - so would be very interested to hear what works for you! It would also be great to hear from you if you've had a better (or worse) experience after trying out my recommendations. There are bound to be lots of exceptions to the "rules" that I've outlined here.