问题
I have installed 3 different versions of Ruby in self hosted agent but i am unable to use them in my vsts task as required. The microsoft document suggests configuring "Agent.ToolsDirectory" but i am not sure how to configure it in the self hosted agents. Can anyone help me with descriptive steps on how to configure it so that i can use the vsts task : "Use Ruby Version task" on my self hosted agent
回答1:
how to configure it in the self hosted agents?
Agent.ToolsDirectory, this is one of capabilities of pool which need you add it in the Org setting. So that while the pipeline executed, it will depend on it.
So, for configure it, just go Org setting-->Agent pools. Click the agent pool where your self host agent is which you have installed 3 different version ruby.
And then point to the agent, and open the capabilities tab and Click Add capability.
Input Agent.ToolsDirectory in the left blank, and add the file path where your ruby installed. For me, I installed it in the file _work_tool of my agent.
After these configured, you can use Use Ruby Version task to point out which version Ruby you want to use with self hosted.
来源:https://stackoverflow.com/questions/56751152/how-to-configure-different-versions-of-ruby-any-other-software-in-self-hosted