Fruits such as bananas are rich in carbohydrates, they contain sugars and starch that serve as primary sources of energy for your body. Your body converts the carbohydrates from bananas into sugar during the natural digestion process. The sugar then travels to your bloodstream and eventually to your cells to provide energy. This would be a great choice of food before gym.
Fruits and vegetables are good, just make sure that at some point during the day (probably better after you workout) you have some sort of protein- peanutbutter sandwhiches can be a good option because they don't need to be refrigerated and they can be taken with you to the gym.