What does Ghandi mean when he says, "Knowledge and devotion, to be true, have to stand the test of renunciation and the fruits of action"?
Ghandi is trying to explain that both knowledge and devotion have to undergo rigorous challenges before either can be proven.
Here are a couple of examples which might help clarify his stance for you.
On knowledge: It used to be a "known" fact that the Earth was flat... until Columbus failed to plunge off the edge of the world. It used to be a known "fact" that the sun revolved around the Earth, until Galileo proved otherwise.
On devotion: Think of the biblical story of Job. Satan challenges God to test his "devoted" servant's true faith. Until Job can withstand the testing, there is no "proof" that his devotion is real. After all, he had been a favorite of God and spoiled with riches and status. But when these things are taken away, he remains devoted. Or, a modern example might be the Civil Rights movement. Would the protestors be devoted to their cause in the face of jail, death, torture? Again, the answer, for most, was yes. But until these things actually happened, there could be little "proof" that their devotion to their cause was real.
For further examples of how to think about this question, please see the link below.