0
votes

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
Could you configure “Agent.ToolsDirectory” successfully with my answer now?Merlin Liang
Thanks for providing a solution Merlin i will try and surely let you know.Arghya
Hi, how are things going? Can you configured it successfully? Please let us know if there is any progressMerlin Liang
i tried configuring the way you said also followed this article to configure the directory structure inside the agents but the tasks are still not picking up the Ruby versions: github.com/microsoft/azure-pipelines-tasks/blob/master/docs/…Arghya
Do i need to add environment variable : VSTS_TOOLS_PATH in the self hosted agents?Arghya

1 Answers

1
votes

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.

enter image description here

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.