President Carter yesterday nominated acting deputy attorney general Charles F. C. Ruff to be U.S. attorney for the District of Columbia, formally ending months of efforts by local political leaders to have a black lawyer named to the prestigious federal prosecutor's job.

Although Mayor Marion Barry said in a statement yesterday that he was pleased with Ruff's selection, he later said informally that he was disappointed that a black had not been selected for the position.

"Of course, I supported the nomination of a black for the U.S. attorney's job. However, now that Chuck has been nominated, I hope that he will be sensitive in hiring blacks and women in his office," Barry said in the statement.

Ruff, who was expected to get the nomination, met with Barry and D.C. Del. Walter E. Fauntroy in Fauntroy's congressional office Tuesday to discuss the U.S. attorney's office, sources said yesterday. During that meeting, Barry said he hoped that Ruff would nominate a black as his principal assistant, these sources said.

If his nomination is confirmed by the Senate, Ruff, 40 would replace Earl J. Silbert, who resigned as U.S. attorney last June and is now in private law practice. Silbert's former principal assistant, Carl S. Rauh, was appointed U.S. attorney by the federal judges here. Carter nominated Ruff to a four-year term. Rauh, who was in effect appointed to an interm position, will step down.

Shortly after Silbert's resignation, Barry, Fauntroy and five other prominent Democratic political leaders told the White House in a letter that they supported Togo D. West Jr. for the U.S. attorney's job. West, who is black, is special assistant to Defense Secretary Harold Brown.

However, once it became clear that former Attorney General Griffin B. Bell and his successor, Benjamin R. Civiletti both favored Ruff for the nomination, West's chances diminished.

"Ruff is a highly qualified, decent person and it was hard to quarrel with it," an administration source said yesterday.

"After some preliminary decisions are made at (the Department of) justice, you're in an untenable position opposing Ruff because of his high qualifications" the source said. West's nomination had faced some opposition because of his limited trial experience, especially as compared to Ruff.

West could not be reached for comment yesterday. As the likelihood of his nomination for U.S. attorney faded, West was frequently mentioned as a possible candidate for general counsel to the Defense Department. The current general counsel, Deanne C. Siemer, is now temporarily assigned to the Department of Energy.

In the months that Ruff was considered the leading candidate for U.S. attorney here, he has also been the Justice Department's chief contact with the city government in developing a plan to give the District full control over its local criminal justice system.

Unlike any other federal prosecutor's office in the country, the U.S. attorney's office here prosecutes all local criminal cases, such as murder and burglary, as well as federal crimes, such as conspiracy and narcotics violations. Ruff has played a key role in developing a plan to transfer the control of all local prosecutions to the city, a move that would significantly change the character of the U.S. attorneys office.

In his statement yesterday, Barry said Ruff "comes to the job with a well-earned reputation of fairness and concern for the problems of the city."

In a telephone interview, Ruff said yesterday that he was "certainly pleased" that Carter had selected him for the nomination to what Ruff described as "one of the best lawyer's job in this town."

After his graduation from Columbia Law School in 1963, Ruff taught American Law in Liberia for two years, was a research associate at Columbia's African Law Center, and taught at the University of Pennsylvania Law School for two years until he joined the Justice Department as a trial lawyer in 1967.

Ruff, who is confined to a wheelchair as a result of polio, was the chief prosecutor in the 1972 trial of former United Mine Workers President W.A. (Tony) Boyle on illegal campaign contributions charges. From 1975 to 1977, Ruff was a member of the Watergate special prosecution force. During that time, Ruff supervised an investigation into former president Gerald R. Ford's campaign finances. The investigation cleared Ford.

As the fourth and final Watergate prosecutor, Ruff closed down that office in June 1977 and moved to the Department of Health Education and Welfare, where he was a deputy inspector general until 1978. The inspector general's office supervises HEW auditors and investigators who investigate abuses in HEW benefit programs.

Ruff has been first associate deputy attorney general since 1978. He has been acting deputy attorney general, the second ranking lawyer at the Justice Department, for the past several months.

"There's very little he hasn't done," said Jon A. Sale, now the chief assistant U.S. attorney in Miami, who worked with Ruff on the Watergate prosecution force.

Sale and others described Ruff as loe-key and as a lawyer with exceptional judgement and a talent for getting to the point of an issue.

Ruff, his wife Susan and their two young daughters, Carin and Christina, live in Northwest Washington.