The 31-year-old, who is now wearing a protective plaster cast following the treatment, missed Saturday's 2-0 win at West Brom due to the problem and is a fresh blow to the England midfielder who has only played a handful of games since a six-month lay-off with a groin problem.
Gerrard, who announced the birth of his third daughter on Tuesday, made his first appearance from the bench in Liverpool's Carling Cup win over Brighton on September 21.
The Reds skipper has only made two Barclays Premier League starts since then, against Manchester United and Norwich.
A statement on the club's official website said: "Steven Gerrard has now undergone treatment to clear out all infection from his right ankle, which has been placed in a protective plaster cast.
"The player will not be available for this weekend's game against Swansea City or for the upcoming England friendlies against Spain and Sweden.
"Steven will now continue his rehabilitation programme under the guidance of the club's medical staff."
England face Spain on November 12 and Sweden three days later, both games at Wembley.