首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何修复Jekyll“找不到JavaScript运行时”错误

如何修复Jekyll“找不到JavaScript运行时”错误
EN

Stack Overflow用户
提问于 2020-02-25 05:25:37
回答 2查看 486关注 0票数 1

我目前正在尝试将Jekyll上传到Gitlab页面,但是,由于某些原因,我在流水线中不断遇到相同的错误消息:

代码语言:javascript
复制
 $ bundle exec jekyll build -d public
 Configuration file: /builds/mmellows1/mighty/_config.yml
 jekyll 3.8.6 | Error:  Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
 ERROR: Job failed: exit code 

我的GEM文件如下所示:

代码语言:javascript
复制
source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
    # bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.4"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.6"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?

gem 'jekyll-compose', group: [:jekyll_plugins]

gem 'jekyll-autoprefixer'

我的gitlab-ci.yml文件如下所示:

代码语言:javascript
复制
pages:
  image: ruby:2.3
  variables:
    JEKYLL_ENV: staging
    LC_ALL: C.UTF-8
  before_script:
    - bundle install
  stage: deploy
  script:
  - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
  only:
  - master
EN

Stack Overflow用户

发布于 2020-02-25 08:06:24

https://github.com/rails/execjs下列出了许多选项(如错误所示)。您需要在Gemfile中添加一个gem,其中将包含一个JavaScript运行时。

我倾向于使用therubyracer,将它添加到Gemfile中,如下所示:

代码语言:javascript
复制
gem "therubyracer"
票数 2
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60384123

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档