If the right rib hurts, it is probably a symptom of liver inflammation.
In fact, the liver itself has no nerves, so there will be no pain, but once the liver is inflamed and swollen, it will cause pain in the right rib.
However, it may also be a gastrointestinal problem, but it also needs a detailed examination by a doctor to know the cause of the pain. So I suggest you go to the hospital for examination, so as not to miss the opportunity of treatment.
The above personal experience is for your reference.