I have a foolproof trick I learned from a Hispanic girlfriend, but you probably won't believe it!
Take an entire head of garlic, the whole thing, don't break it up into garlic cloves, and boil it with your beans. I use two heads just to be on the safe side, but my friend uses only one. She said this is the traditional Mexican way to cook beans to guarantee no gas and it works like a charm.
I pick over the beans and add around 3" of cold water on top and add the garlic. Don't soak the beans first, just use dried beans. Bring to a boil and simmer. The beans also cook faster this way for some reason, so you have to watch them. While they're still a little undone, add your vegetables. While cooking the beans, make sure you add boiling water or boiling stock if you need to add more liquid. Don't add room temperature water or stock. Cook the vegetables along with the garlic heads. When beans and vegetables are cooked, remove the heads of garlic and serve your beans. The papery stuff on the outside of the garlic heads will not come off while cooking so don't worry.
I hope you will try this and enjoy beans without the usual side effects! It sounds weird, I know, I didn't believe it till I tried it.