Chronic rib cage pain

Hello,

For several months now I have been living with debilitating rib cage pain. It started with spasms in by upper chest wall which of course led to a battery of heart tests.. all was clear so then my doctor started me on 500mg of naproxen. Unfortunately after 2 weeks a developed a bad stomach ulcer so I had to stop. Since then I’ve got bad pain in the centre of my sternum and in my xiphoid process and now the last 2 weeks really bad flank pain. 

Also when ever I bend over I feel popping all the way up my spine.. 

Is there something I’m missing or something els I can do for pain? 

Please help 

It happened with me after I they prescribed me Naproxen. severe acidity and triggered my acid reflux too. Stopped it forever and added it as alergy .