Bananas and as I need at least 15 characters, don't forget to eat bananas during your ride as well.
bicycles.stackexchange.com/users/825/Duncan McGregor
Chris's answer is good if you are planning for some serious training/ride.
IMHO, if you ride just a few Kms there's not even need for a particular diet, as long as it's mixed and well balanced.
I stick to such a regular diet for rides of 50 Km or less, otherwise some tuning (as described by Chris) is needed.
bicycles.stackexchange.com/users/777/Simone
That depends on the type of ride, but generally something not too heavy with plenty of complex carbs is good before a long ride.
You want something that is going to release plenty of energy over the course of the ride.
Porridge, maybe with yogurt and stewed fruit, works really well for me.
After a ride, there's a 15 minute recovery window where you want to replace those carbs and also get some protein, so your body can replenish its energy reserves and rebuild muscle mass.
There are specialist recovery drinks that do this, but to be honest a milkshake made with semi or skimmed milk and not too much sugar is ideal.
bicycles.stackexchange.com/users/820/Chris Betterton
I just consider the nature of the ride I plan to do.
And think of the time I'll be on the bike and the intensity of the ride.
A short commute, errand or casual ride.
Probably nothing more is needed other than normal balanced meals with a snack (energy bar, banana, fig bar, or whatever you prefer) in your pocket.
A long commute/errand or moderate fitness ride.
Preferably a meal 1 - 2 hours before the ride (60% Carbs, 20% Protein, 20% Fat); then a high carb snack 30 minutes before the workout (granola bar, banana, etc); after the ride a light meal/snack with a 4:1 carb/protein ratio within 2 hours.
High intensity fitness training/fitness rides such as interval training.
A meal and snack, as above, 1 - 2 hours and 30 minutes before; an energy/electrolyte drink during the workout; and a recovery meal/snack as above.
Very long rides where you'll be on the bike for several hours, such as centuries.
Same as the previous.
However during the ride, it pays to eat and hydrate throughout.
I find that I'm eating the equivalent of a high carb energy bar about every hour.
This is a rough answer as there are entire books on the subject of exercise nutrition.
A couple that I've found useful are by Chris Carmichael .
One is Food for Fitness and another is
The Time Crunched Cyclist .
bicycles.stackexchange.com/users/None/
The only thing to 'make sure' to eat is carbohydrates, protein, fat, salt, and water, in any form.
Here are some of my favorite snacks to eat while cycling-
as opposed to before/after; some make the list because they are ubiquitous at convenience stores (in order of quantity that I have consumed) misc 'bar' peanut butter sandwich (banana and honey optional) sandwich bananas equal parts soda:water (optimum osmotic pressure for sugar uptake as recommended by Greg Lemond, first line of defense when a bonk is coming on) peanuts pop-tarts Before/after long rides: pancakes with peanut butter oatmeal with fruits and nuts big bowl of cereal eggs
"a rare steak is a good breakfast for what lies ahead" "A Sunday in Hell" Roger de Vlaeminck eating a pre-race meal at 15:09 (make sure to cut small pieces and chew well!)
protein shake burrito shwarma
bicycles.stackexchange.com/users/839/David LeBauer
I love the honey stinger waffles.
It is like a 3-inch waffle with honey in the middle.
It is all natural, very tasty and fits very nicely into the seat bag or back pocket.
Only drawbacks are that they can be challenging at the moment to get into.
There is supposed to be new packaging this year (2011).
There also is no protein but on the ride itself that should not be a problem.
bicycles.stackexchange.com/users/1068/john busteed
What should a bicyclist make sure to eat before and after riding a bike?
What should one eat while cycling?
bicycles.stackexchange.com
<nutrition>
bicycles.stackexchange.com/questions/2225
bicycles.stackexchange.com/users/824/Lea Aharonovitch
Most cyclists do not require a special diet. It is important to have enough carbohydrates and to have a banana or energy bar with you during the ride, and water , of course. After a long ride, it is important to replensh protein and carbohydrate.  Opinions on this subject vary. Some people recommend specific food types, such as fruit or sweets, while others propose consuming the calories corresponding roughly to a high carb energy bar. It is important to follow a mixed and balanced diet, including carbohydrates, protein, fat, salt and water. You might also want to consider the type of ride. Short commutes require regular balanced meals. For long distances, it is recommended that you plan your meal carefully some hours before starting, hydrate frequently and have a snack after the ride. You should replenish your energy with carbs, protein and recovery drinks, but not eat too heavy. 
Some people recommend specific food types, such as fruit or sweets. It is important to follow a mixed and balanced diet, including carbohydrates, protein, fat, salt and water, especially for short distances. It would be a good idea to consume the calories corresponding roughly to a high carb energy bar. You might want to consider the type of ride. Short commutes require regular balanced meals. For long distances, it is recommended that you plan your meal carefully some hours before starting, hydrate frequently and have a snack after the ride. You should replenish your energy with carbs, protein and recovery drinks, but not eat too heavy. 