setup-ruby
setup-ruby copied to clipboard
Does not work with self-hosted
When I run on a self-hosted runner I always get an error that ruby was not found,
Preatty sure it has something to do with your note
. Note that this action only uses versions of Ruby already installed in the cache.
How do I prime that cache?
Can anyoane please make me understand how this works, our build server spends a lot of time now building ruby every time, the energy consumption escalates to the climate problems we are having.
This action uses only versions in the tool cache as explaind in README.
optionally installing a version of ruby and adding to PATH. Note that this action only uses versions of Ruby already installed in the cache. The action will fail if no matching versions are found.
If self-hosted runner doesn't provide a way to build tool caches, which has been installed in default virtual-environments, I guess you need to setup Ruby by yourself without this action.
You can populate a tool cache directory with various versions and it will work. I will try and write something up. (hint: run env to see the tool cache root and dump it's directory structure on a hosted run).
https://github.com/actions/setup-ruby/issues/44
Heya, just started needing Ruby env on a self hosted runner. Not sure what to do here? Self hosted is my only option. Not sure if there is a long way round as sudo access is not usable. Thanks!
This is something we've dealt with as well, and as a work around we cache several rubies, pythons, sbt's in our runner image. It would be awesome if we could use the setup-*
in self-hosted. 🙏
If self-hosted is there any guarantee it's running one of the well-known virtual environments (ubuntu-latest/macos-latest/windows-latest)? If not, then it seems necessary to build Ruby yourself on that runner.
Then you would like to use setup-*
with that pre-installed Ruby?
That might already work if the pre-installed Ruby is recognized as part of the tool cache.
This action doesn't do much beyond adding ruby/bin
to PATH though.
If the goal is to do matrix testing (test my code against all these versions of ruby) then I think as long as you build and populate the tool cache in the prescribed directory layout it should work. Which is what find does: https://github.com/actions/setup-ruby/blob/master/src/cache.ts#L6
Should be something laid out in the cache dir by tool name, version and optionally arch.
$(RUNNER_TOOL_CACHE)
|_ ruby
|_ (version)
|_ [arch]