Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Runner image doesn't support setup-ruby #2892

Open
louim opened this issue Sep 27, 2023 · 5 comments · May be fixed by #2978
Open

Action Runner image doesn't support setup-ruby #2892

louim opened this issue Sep 27, 2023 · 5 comments · May be fixed by #2978
Labels
bug Something isn't working Stale

Comments

@louim
Copy link

louim commented Sep 27, 2023

Describe the bug
When using the action runner image, the setup-ruby action is not supported out of the box.

To Reproduce
Steps to reproduce the behavior:

  1. Use the latest version of the image (in our case, installed as part of ARC using the getting started guide)
  2. Add the setup-ruby action to a workflow running on the self hosted runner:
- name: Setup Ruby and install gems
  uses: ruby/setup-ruby@v1
  with:
    bundler-cache: true
  1. See the error
Run ruby/setup-ruby@v1
with:
  bundler-cache: true
  ruby-version: default

Using 3.1.3 as input from file .tool-versions
Modifying PATH
Entries added to PATH to use selected Ruby:
  /opt/hostedtoolcache/Ruby/3.1.3/x64/bin
Error: Error: EACCES: permission denied, mkdir '/opt/hostedtoolcache'

Expected behavior
As recommended in the guides, I expect the setup action for ruby to be able to complete correctly. It looks like however that the expected global RUNNER_TOOL_CACHE path is not available on the container, but this path is required because prebuild rubies are generated in this path. See this section for more info: https://github.com/ruby/setup-ruby#using-self-hosted-runners

Runner Version and Platform

239.0

Linux.

What's not working?

The Error: Error: EACCES: permission denied, mkdir '/opt/hostedtoolcache' doesn't exist, and the runner cannot write to it.
image

@louim louim added the bug Something isn't working label Sep 27, 2023
@eggshell
Copy link

eggshell commented Oct 6, 2023

Nothing to add other than I'm having the exact same issue.

@mayur2281
Copy link

Still facing the issue, any solutions?

@parasquid
Copy link

This was one of the top hits on Google so I thought this may help someone.

I'm using a self-hosted runner and I needed to create the folder /opt/hostedtoolcache and have it chown'ed by the user that does the running. That fixed the issue for me.

@AlfonsoUceda
Copy link

I've done this as a workaround in my custom docker image that inherits from ghcr.io/actions/actions-runner:latest.

RUN mkdir -p /opt/hostedtoolcache && chown -R runner:runner /opt/hostedtoolcache

I hope this helps people with the same problem

Copy link
Contributor

github-actions bot commented Mar 3, 2025

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants