因为我的博客是GitHub Pages搭建的,纯静态也主打迁移方便。当然今天写文章的时候报错了。
build The current runner (ubuntu-24.04-x64) was detected as self-hosted because the platform does not match a GitHub-hosted runner image (or that image is deprecated and no longer supported). In such a case, you should install Ruby in the $RUNNER_TOOL_CACHE yourself, for example using https://github.com/rbenv/ruby-build You can take inspiration from this workflow for more details: https://github.com/ruby/ruby-builder/blob/master/.github/workflows/build.yml $ ruby-build 3.1.4 /opt/hostedtoolcache/Ruby/3.1.4/x64 Once that completes successfully, mark it as complete with: $ touch /opt/hostedtoolcache/Ruby/3.1.4/x64.complete It is your responsibility to ensure installing Ruby like that is not done in parallel.
试了下AI,他只会让我按照提示操作,给我重写了一个yml,安装ruby。结果等了十多分钟还没deploy好。
网上搜了以下,这个帖子找到了解决方案 https://github.com/ruby/setup-ruby/issues/595 感谢kachick大佬提供的方法,只需要更换一行代码,使用新版本的ruby就行了。
1
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
更换为下面这行
1
uses: ruby/setup-ruby@086ffb1a2090c870a3f881cc91ea83aa4243d408 # v1.195.0
尽管AI可以帮助我们做很多事情,提高效率,但是首要还是使用搜索引擎,尤其是解决问题。