首页 > 解决方案 > Jekyll + Github Actions + JavaScript 运行时问题

问题描述

我最近决定用 Jekyll 开始我的网站。事情看起来很简单,但我自己不太精通宝石;)

为方便起见,我使用 Jekyll GitHub 操作(官方以及我在 Git 上找到的其他一些操作)。

我一直在处理同样的问题。

我已尝试按照在多个站点上找到的说明以及有关错误的建议进行操作。

我附上了我的 Gemfile 以及错误

我的 git repo 是https://github.com/stiliajohny/stiliajohny.github.io

Github 操作在 ubuntu-latest 上运行(我尝试过的大部分都在同一平台上运行)

**编辑:**在我的本地作品上构建它很好

source "https://rubygems.org"

gem "jekyll" , "3.8.7"
gem "bundler"
gem "dev-portfolio-blog"
gem "html-proofer"
gem "execjs"
️ Building website...
Configuration file: /github/workspace/repo/_config.yml
/usr/local/bundle/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
jekyll 3.8.7 | Error:  Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
    from /usr/local/bundle/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'

标签: rubygemsjekyllgithub-actionsjekyll-theme

解决方案


尝试添加gem "therubyracer"到 Gemfile。将 V8 JavaScript 解释器嵌入到 Ruby 中。


推荐阅读