As fresh beans stay on the vine and mature and dry, they are turning simple sugars into more complex sugars which will last longer. While the plant does this so the seeds will remain viable for a longer time, it's these complex sugars/carbs that cause problems with digestion.
Inulin is an example of one such complex carbohydrate. There is a lot of it in Jerusalem artichokes, and that's why some people complain that it is a "gassy vegetable".
There are two approaches to solving the gas problem: (1) Get rid of these complex carbohydrates in the cooking process. For beans, it is recommended that after you soak the dried beans, you toss out the soak water and start fresh. That soaking water did more than just rehydrate the beans; some of the complex carbohydrates that are soluble can be leached out. You could also add digestive enzymes to the soak water -- spit in the soak water and add the
amylase from your own saliva to work on it overnight (by the way, that's why they tell you not to eat yogurt from the container with a spoon and then put it back in the fridge -- your amylase from the spoon makes the yogurt runny later).
If spitting in the soak water for the beans sounds gross, there is the other option: (2) Work on your own gastrointestinal health so that you can break down the complex carbs without turning into another
LePetomane. Beano is one product that adds digestive enzymes orally so that you can have them working in your gut when you need them. It's a one-simple-pill substitute for having a healthy GI tract flora that comes from a diet of fermented foods full of beneficial bacteria (yogurt, sauerkraut, kimchi, buttermilk, kefir, Limburger cheese, French cheeses like brie with powdery rind, etc.). "Probiotics" are also a substitute, whether they are added to foods, or served in a small shot of flavored liquid. For me, I like the taste of fermented foods (well, maybe not natto), so I will go for the wholesome natural approach.