The 35-year-old defender picked up the injury while on international duty.
Madrid face the Reds on Tuesday, 6 April and Wednesday, 14 April, either side of El Clasico with Barcelona in La Liga.
“If there is something that hurts me, it is not being able to help the team in these highly demanding matches,” said the Spaniard on Instagram.
Ramos said he noticed the problem while on the training pitch following Spain’s 3-1 victory against Kosovo and scans on Thursday confirmed the injury.
Real are at home for the first leg against Liverpool.
The tie was due to pit Ramos against forward Mohamed Salah, who suffered a shoulder injury in a challenge from Ramos during the 2018 final in Kiev.
Real went on to win that game 3-1, but Salah said earlier this week he bears no grudges.
“Let’s say I have a special desire to win the game and to qualify for the semi-final, whatever happens now is not going to change the result of Kiev. It’s over,” he told Spanish newspaper Marca.