Appendix pain would come over the lower right quadrant of your abdomen(McBurney's point). The right rib pain could be due to any local trauma, I would advise you to visit the ER so that you can be examined and undergo investigation such as an X-Ray to find any underlying problems and have it treated accordingly.
Next Steps
Follow the steps as advised
Health Tips
If condition persists or worsens visit the ER at the earliest