How To Use Ruby Which is Installed on Self Hosted Runner Of Github Workflow {ruby/setup-ruby }

1.3k views Asked by At

I have a self hosted runner for Git hub workflow ,which requires Ruby for the execution .. I tried to use ruby/setup-ruby which is a prebuilt ruby ..But when I use that it gives me a error as below

  • Unable to locate executable file: 7z. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.

my yml file related to setting up prebuilt ruby is as follows

- uses: ruby/setup-ruby@v1
    env:
      ImageOS : win19
    with:
      ruby-version: '2.6.5'

enter image description here

  • So I have installed ruby on the server manually. Now I want to use that manually installed Ruby instance inside my Yml file.. Any advise?

i have added 7zip to my environmental variables and verified that its added as follows

enter image description here

the service which is used to communicate my runner with GitHub also works fine as it shows my runner state correctly as follows even I am not executing any workflow action on it..

enter image description here

1

There are 1 answers

15
riQQ On

Install 7-Zip on your runner, add the directory, that contains 7z.exe, to the PATH environment variable and restart the runner service so it picks up the updated PATH environment variable.

Refer to this for more details on updating the PATH environment variable.