"This was the toughest decision of my life," said the 25-year-old Bayer Leverkusen goalkeeper in a statement. "But it would have been simply irresponsible of me, my club and the national team to have participated in the World Cup."
Adler said there was nothing medically keeping him from playing.
"But the pain is so great that I would not have been able to perform at my best over the longer term both in training and during matches," he said. "In such a long and intensive tournament, that is unacceptable. You need players who are totally fit."
Having missed the last few weeks with the rib injury, Adler returned on Saturday for Leverkusen in their 1-1 draw with Hertha Berlin.
But an examination by Germany team doctor Hans-Wilhelm Müller-Wohlfahrt has revealed the injury is worse than first thought.
He has already suffered a complicated rib injury which needed a titanium plate and four screws to repair in 2006, which nearly ended his career.
Germany coach Joachim Löw is set to name his World Cup squad on Thursday.
"Of course, we are very sorry that Rene will now be operated on, but he has
to have the procedure," said Löw.
"The coaching team will now meet to discuss who will replace Rene in travelling to South Africa and we will announce our nomination in Stuttgart on Thursday."
Former Germany striker Rudi Völler said Adler's injury is a bitter blow for the national team.
"I feel incredibly sorry for Rene," said Leverkusen's director of sport Völler. "His great World Cup dream has burst, but now we must accept the doctor's decision. "I hope and firmly believe that Rene will be between the posts for Germany's next major tournament."
With Adler ruled out, Schalke 04's Manuel Neuer is set to take his place in goal for Germany's opening World Cup match in Group D against Australia on June 13 with Werder Bremen's Tim Wiese also travelling.
Löw had been set to take three goalkeepers to South Africa, meaning Bayern Munich
veteran Hans-Jörg Butt could be set for a surprise recall nearly seven years
after winning the last of his three caps for Germany. Dortmund's Roman Weidenfeller could also be an option.
Germany face warm-up matches against Malta on May 13 in Aachen, Hungary in Budapest on May 29 and Bosnia-Herzegovina in Frankfurt on June 3.
They have drawn Australia, Ghana and Serbia in Group 4 of the World Cup as they bid to win the title for the fourth time.