Earthquake rattles two Caribbean countries