If you are having any difficulties that cause you not to be able to do something necessary for life, see a doctor immediately. Though, it sounds like a kidney problem.
It may be due to any infection in the intestine, pancreas, digestive system or gastro and bowel disorders. Or it may be due to costochondrites. So consult a doctor.
The most common cause of pain in the left rib related with digestive track is Hiatus hernia. When upper part of the somach is bulged through the gap of diaphram, it is known as Hiatus hernia.