The Munster player, 28, was taken off on a stretcher in the 75th minute of Ireland's 35-21 win in Cardiff.
O'Donnell, who was hoping to play in his first World Cup, was treated at University Hospital Wales, where his injury was confirmed on Sunday.
Back Andrew Trimble will have a scan on the foot he injured during the game.
Irish Rugby said Trimble's scan - on an injury Ireland coach Joe Schmidt described as a "mild foot sprain" - would be "precautionary".
But with O'Donnell "limited to non-weight bearing activity for at least six weeks", the IRFU said he was "unfortunately" ruled out.
The Munster forward fell awkwardly as he attempted to drive for the Wales line and was given an oxygen mask before being transferred on to a stretcher.
His injury may further open the door to Chris Henry's inclusion in Ireland's 31-man squad for the World Cup, alongside other back-row players Jamie Heaslip, Peter O'Mahony, Sean O'Brien and Jordi Murphy.
Ireland start their World Cup campaign against Canada in Cardiff on 19 September.
Ireland flanker Tommy O'Donnell has been ruled out of the World Cup after he dislocated a hip during Saturday's warm-up victory over Wales.