rubygems - 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>'
解决方案
尝试添加gem "therubyracer"
到 Gemfile。这将 V8 JavaScript 解释器嵌入到 Ruby 中。
推荐阅读
- reactjs - 我想在模拟 promise 方法时返回两个不同的响应
- python - 我想在 RSS 提要描述标签中获取图片链接
- javascript - 如何根据标签等条件删除子元素,
- c# - IIS 应用程序池已关闭,事件 ID 为 5009
- java - Hibernate & MariaDB auto_increment 没有通过级联正确设置 FK
- sql - 如何避免将来在 sql server 中出现重复
- database - 使用位置运算符更新 mongoengine 中的文档仅更新数组中的第一个元素
- javascript - call() a function within its own context
- azure-devops - 包含在 repo 中时找不到任何 iOS 开发配置文件
- c# - 如何按日期的一部分动态过滤