Ramafosa said in a statement that he had convened a security meeting with law enforcement to stop the violence.
He stated that there was no excuse for the attacks and warned that violence against foreign companies could trigger xenophobic attacks against South Africans living abroad.
"Attacks against people who run businesses by foreign nationals are completely unacceptable," Ramafosa said.
"There can be no excuse for people having a complaint that they should go out and attack people from other countries, because when they do this, they also need to know that South African colleagues will be attacked in other countries, "the president said.
Several shops and businesses were looted and burned in a riot that broke out in a Johannesburg neighborhood on Sunday, according to South African police.
The Government of Nigeria called on its ambassador, Bobby Moro, on Wednesday, saying that some of its citizens were targeted in the attacks.
President Muhammadu Buhari stated that he was very concerned about the situation and also sent a delegation to meet with Ramafos on the attacks.  The Zambian Ministry of Transport has also warned truck drivers against traveling to South Africa until security concerns are resolved, according to a local media release.