0

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

RAINA
  • 314
  • 4
  • 17

1 Answers1

0

Install 7-Zip on your runner and add the directory, that contains 7z.exe, to the PATH environment variable.

riQQ
  • 4,188
  • 4
  • 19
  • 33
  • thank you for the response..i tried adding the path. And i verified that the 7zip is added to environmental variable through the CMD by hitting 7z ..but still the error exists. – RAINA Dec 25 '20 at 04:22
  • Did you set the path variable for the user that ist running the GitHub Actions Runner? – riQQ Dec 25 '20 at 09:08
  • i am not aware of it..can you please provide me a link to follow it.. – RAINA Dec 25 '20 at 14:04
  • It depends how you set it up. Did you follow https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/adding-self-hosted-runners#adding-a-self-hosted-runner-to-a-repository ? In step 6 there is a note about setting up the runner as a Windows service. Did you do that? – riQQ Dec 25 '20 at 20:28
  • yes i did that. And the service is running fine..i even tried running the workflow without using ruby..and it generated the apk without any issue.. – RAINA Dec 26 '20 at 02:14
  • the issue is i need ruby to decode my secret keys and access loggings which are encrypted. – RAINA Dec 26 '20 at 02:15
  • Check in the Windows services under which user the GitHub runner service is running. Make sure that the PATH for this user is setup correctly. – riQQ Dec 26 '20 at 22:14
  • windows service is listed correctly for the user as i was able to generate artifacts without ruby..any other suggestions – RAINA Dec 27 '20 at 06:56
  • Have you restarted the service after setting the PATH variable? – riQQ Dec 27 '20 at 09:52
  • No..i did not..you mean after setting the 7zip path , do i need to restart GitHub runner service ? – RAINA Dec 28 '20 at 10:27
  • Yes, exactly. After updating the PATH env variable restart the GitHub runner service. – riQQ Dec 28 '20 at 16:57
  • it did not work..i tried restarting the github service too..but no luck..but after restarting the github service i am getting following error now .. " Parameter 'commandLine' cannot be null or empty." – RAINA Dec 28 '20 at 17:54
  • According to your screenshot above you overwrote your %PATH% variable instead of appending the 7-Zip path to it. – riQQ Dec 28 '20 at 18:49
  • can you please guide me how to correctly append it ? – RAINA Dec 29 '20 at 03:25
  • See https://stackoverflow.com/questions/9546324/adding-a-directory-to-the-path-environment-variable-in-windows – riQQ Dec 29 '20 at 09:17