bundle exec jekyll serve > 冲突:以下目标由多个文件共享
bundle exec jekyll serve > Conflict: The following destination is shared by multiple files
环境
- Windows 10
- ruby 3.0.0p0
- 杰基尔 4.2.0
- 捆绑器
到达此处的步骤
- 已安装 ruby 和 jekyll 使用说明:https://jekyllrb.com/docs/installation/windows/#installation-via-rubyinstaller
- 克隆现有的 jekyll 存储库(使用最小错误主题)
- 已成功执行
bundle update
更新所有依赖项。
- 手动安装
wdm
Gemfile 看起来像这样:
source "https://rubygems.org"
gemspec
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
问题
jekyll serve
和 bundle exec jekyll serve
命令失败并出现以下错误:
$ bundle exec jekyll serve
Configuration file: C:/Users/linds/ueducateus-website/_config.yml
Source: C:/Users/linds/ueducateus-website
Destination: C:/Users/linds/ueducateus-website/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
Conflict: The following destination is shared by multiple files.
The written file may end up with unexpected contents.
C:/Users/linds/ueducateus-website/_site/index.html
- index.html
- index.html
- index.html
- index.html
- index.html
done in 1.511 seconds.
Auto-regeneration: enabled for 'C:/Users/linds/ueducateus-website'
------------------------------------------------
Jekyll 4.2.0 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `require_relative'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `setup'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:100:in `process'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
from C:/Ruby30-x64/bin/jekyll:23:in `load'
from C:/Ruby30-x64/bin/jekyll:23:in `<main>'
额外
- 站点在 Ubuntu 18.04 上成功构建,使用 Ruby 2.5.1 和 Jekyll 4.0
- 很遗憾交接,站点文件需要在Windows
- 此问题可能与 https://github.com/kubevirt/kubevirt.github.io/issues/665
有关
- 有运行
jekyll serve --trace
但结果相同
webrick 似乎没有与 ruby 3.0 捆绑在一起。检查这个 jekyll github issue.
From
https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/:
The following libraries are no longer bundled gems or standard
libraries. Install the corresponding gems to use these features.
sdbm webrick net-telnet xmlrpc
你有两个选择
- 降级到 ruby 2.5,就像 ubuntu 或
- 在 Gemfile 中添加
gem "webrick"
。
环境
- Windows 10
- ruby 3.0.0p0
- 杰基尔 4.2.0
- 捆绑器
到达此处的步骤
- 已安装 ruby 和 jekyll 使用说明:https://jekyllrb.com/docs/installation/windows/#installation-via-rubyinstaller
- 克隆现有的 jekyll 存储库(使用最小错误主题)
- 已成功执行
bundle update
更新所有依赖项。 - 手动安装
wdm
Gemfile 看起来像这样:
source "https://rubygems.org"
gemspec
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
问题
jekyll serve
和 bundle exec jekyll serve
命令失败并出现以下错误:
$ bundle exec jekyll serve
Configuration file: C:/Users/linds/ueducateus-website/_config.yml
Source: C:/Users/linds/ueducateus-website
Destination: C:/Users/linds/ueducateus-website/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
Conflict: The following destination is shared by multiple files.
The written file may end up with unexpected contents.
C:/Users/linds/ueducateus-website/_site/index.html
- index.html
- index.html
- index.html
- index.html
- index.html
done in 1.511 seconds.
Auto-regeneration: enabled for 'C:/Users/linds/ueducateus-website'
------------------------------------------------
Jekyll 4.2.0 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `require_relative'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `setup'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:100:in `process'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
from C:/Ruby30-x64/bin/jekyll:23:in `load'
from C:/Ruby30-x64/bin/jekyll:23:in `<main>'
额外
- 站点在 Ubuntu 18.04 上成功构建,使用 Ruby 2.5.1 和 Jekyll 4.0
- 很遗憾交接,站点文件需要在Windows
- 此问题可能与 https://github.com/kubevirt/kubevirt.github.io/issues/665 有关
- 有运行
jekyll serve --trace
但结果相同
webrick 似乎没有与 ruby 3.0 捆绑在一起。检查这个 jekyll github issue.
From https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/:
The following libraries are no longer bundled gems or standard libraries. Install the corresponding gems to use these features.
sdbm webrick net-telnet xmlrpc
你有两个选择
- 降级到 ruby 2.5,就像 ubuntu 或
- 在 Gemfile 中添加
gem "webrick"
。