The last painful attack I had (more than two years ago now) was caused by, believe it or not, eating rice cakes. It took me two weeks to recover.
The reason for the attack, I found out later, is because rice cakes are made from brown rice (insoluble fibre). White rice (soluble fibre) is usually safe to eat, but many IBS people have difficulty tolerating brown rice, which like whole wheat flour, can cause attacks. As far as I know, most rice cakes are made from brown rice.
I would recommend staying away from rice cakes! Hope this helps and hope you feel better soon.