Ruby “如何修复杰基尔”;找不到JavaScript运行时";错误
我目前正在尝试将Jekyll上载到Gitlab页面,但由于某些原因,我在管道中不断遇到相同的错误消息:Ruby “如何修复杰基尔”;找不到JavaScript运行时";错误,ruby,jekyll,gitlab-pages,Ruby,Jekyll,Gitlab Pages,我目前正在尝试将Jekyll上载到Gitlab页面,但由于某些原因,我在管道中不断遇到相同的错误消息: $ 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
$ 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文件如下所示:
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'
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
我的gitlab-ci.yml文件如下所示:
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'
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
下面列出了许多选项(如错误所示)。您需要向gem文件中添加一个包含JavaScript运行时的gem 我倾向于使用,将其添加到您的GEM文件中,如下所示:
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'
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
gem“therubyracer”
非常感谢!这修复了它,但我使用了“mini_racer”。无论是therubyracer
还是mini_racer
都不适合我使用。另见我的问题