Struggle veteran Ahmed Kathrada died early on Tuesday morning‚ his foundation said..
In a speech prepared for delivery at the St John's College fund raising gala dinner in Mthatha in the Eastern Cape on Friday, Ramaphosa said the school had been favoured with good teachers.
The school turned 135 this year.
"For a school to reach this age, for it to produce generations of outstanding leaders and remarkable people there is something special that it must have done well," he said.
"My guess, and the alumni can tell me if I am wrong, is that St John's has been favoured with good teachers."
Former president Thabo Mbeki, Eastern Cape premier Phumulo Masualle and former head of the National Prosecuting Authority Vusi Pikoli are part of the school's alumni.
He said the school had sought to attract and nurture teachers who were focused on producing well-educated children and improving themselves as teachers.
"It is this enduring attribute that we find in St John's that is so often missing in our country today."
He said for young people to reach their full potential, the country needed teachers with the ability and commitment to nurture and develop them.
In a study conducted by consulting firm McKinsey & Company titled "How the world's best-performing school systems come out on top" published in 2007, Ramaphosa said three key factors were noted.
These were - getting the right people to become teachers, developing them into effective instructors and ensuring that the system was able to deliver the best possible instruction for every child, he said.
"These findings underline our contention that transforming our education system requires a sustained focus on the quality of our teachers and principals.
"Teachers are not the problem. Teachers are the solution of many of our problems."
He said the National Development Plan emphasised the need to improve the quality of teacher training and the recruitment of higher calibre candidates.
The plan also identified ways to empower teachers already in service by improving their knowledge of the subjects they taught, providing training in effective teaching methods, and addressing their working conditions and remuneration.
"We need to restore the status of teachers in our communities. Teaching needs to once again become the favoured profession of capable, dedicated and ambitious young South Africans."
Teachers needed to earn respect by not taking part in activities which brought their profession into disrepute.
"Through their actions, they need to restore the integrity and moral standing of the important positions they occupy."
Ramaphosa said South Africa needed educated citizens who could compete in a globalised world.
"We need to build a capable generation that is armed with the knowledge, skills, cognitive ability and drive to elevate our productivity and improve our competitiveness."