【问题标题】:bundle exec jekyll serve > Conflict: The following destination is shared by multiple filesbundle exec jekyll serve > 冲突:以下目的地被多个文件共享
【发布时间】:2021-06-20 19:16:27
【问题描述】:

环境

  • Windows 10
  • 红宝石 3​​.0.0p0
  • jekyll 4.2.0
  • 捆绑器

到这里的步骤

Gemfile 看起来像这样:

source "https://rubygems.org"
gemspec
gem 'wdm', '>= 0.1.0' if Gem.win_platform?

问题

jekyll servebundle 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>'

附加

【问题讨论】:

  • 我注意到的一件事是,在 Win 上你有 Ruby 3.0 和 Ubuntu 上的 ruby​​ 2.5(尝试降级)。错误说 webrick 丢失。尝试安装它“gem install webrick”

标签: ruby jekyll


【解决方案1】:

似乎 webrick 没有与 ruby​​ 3.0 捆绑在一起。检查这个jekyll github issue

https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/:

以下库不再是捆绑的 gem 或标准 图书馆。安装相应的 gem 以使用这些功能。

sdbm webrick net-telnet xmlrpc

你有两个选择

  1. 像在 ubuntu 上一样降级到 ruby​​ 2.5 或
  2. 在 Gemfile 中添加 gem "webrick"

【讨论】:

  • 添加gem "webrick" 允许网站构建——谢谢。它还没有解决多地址冲突,但我记得在这个主题上看到了另一个由类别插件引起的问题——感谢您对此的帮助:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多