Baby, it's one of those things impossible to diagnose over the internet really, because there's obviously a whole host of things that can cause rib pain, and many of them would be ruled out by physical examination by a doctor - palpitation etc.
Referred pain, in particular, is tricky, and the bailiwick of pain management professionals; typical GIs or PCPs know little in depth about
the different effects pain can have on the body.
But if you are worried about
cancer, I would say that this is extremely rare, and usually occurs long after tumours have appeared elsewhere; rib pains would be an advanced symptom, and a diagnosis could be expected to lie months back.
My guess is, that in my case at least, it is associated with the severe muscle fatigue caused by chronic malnutrition, possible a build up of lactic acid in the intercostal muscles - rather like getting a stitch from running too far - or, equally possible, hyperventilation causing lactic acid build up. Both of these might be related to an pH imbalance in the blood, which is entirely possible for anyone breathing lots of traffic fumes, never mind with a Crohnie. But either way, if you start having severe pains in your rib cage and chest and having difficulty breathing, it is most likely anxiety related. (Hyperventilation, which is related to high blood levels of carbonic acid, can supposedly predispose towards panic attacks.)
You'll have noticed I'm guessing here, I ain't no doctor ! I wonder just what percentage of Crohnies get rib pain, and under what circumstances ?