【问题标题】:GitHub Pages and Jekyll MacOSGitHub 页面和 Jekyll MacOS
【发布时间】:2021-08-11 15:15:48
【问题描述】:

我正在 MacOS Catalina 10.15.7 上通过 Jekyll 创建一个 GitHub 网站。

当我运行命令 bundle exec jekyll serve 时,它会导致错误。

我的项目在这里:https://github.com/dbarnes18/dbarnes18,我的错误在这里:

dillonbarnes@Downstairs-iMac gh-pages % bundle exec jekyll serve
Configuration file: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/_config.yml
            Source: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages
       Destination: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.282 seconds.
 Auto-regeneration: enabled for '/Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages'
bundler: failed to load command: jekyll (/Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/bin/jekyll)
/Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:184:in `require_relative'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:184:in `setup'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:102:in `process'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `block in start'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `each'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `start'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/exe/jekyll:15:in `<top (required)>'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/bin/jekyll:23:in `load'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/bin/jekyll:23:in `<top (required)>'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:63:in `load'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:63:in `kernel_load'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:28:in `run'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:494:in `exec'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:30:in `dispatch'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:24:in `start'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/exe/bundle:49:in `block in <top (required)>'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/exe/bundle:37:in `<top (required)>'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/bin/bundle:23:in `load'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/bin/bundle:23:in `<main>'
dillonbarnes@Downstairs-iMac gh-pages % jekyll b
/Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/runtime.rb:302:in `check_for_activated_spec!': You have already activated i18n 1.8.10, but your Gemfile requires i18n 0.9.5. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/runtime.rb:31:in `block in setup'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/spec_set.rb:163:in `each'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/spec_set.rb:163:in `each'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/runtime.rb:26:in `map'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/runtime.rb:26:in `setup'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler.rb:148:in `setup'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/jekyll-4.2.0/exe/jekyll:11:in `<top (required)>'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/bin/jekyll:23:in `load'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/bin/jekyll:23:in `<main>'
dillonbarnes@Downstairs-iMac gh-pages % bundle exec jekyll build
Configuration file: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/_config.yml
^[[A            Source: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages
       Destination: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.271 seconds.
 Auto-regeneration: disabled. Use --watch to enable.
dillonbarnes@Downstairs-iMac gh-pages % bundle exec jekyll serve
Configuration file: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/_config.yml
            Source: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages
       Destination: /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.232 seconds.
 Auto-regeneration: enabled for '/Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages'
bundler: failed to load command: jekyll (/Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/bin/jekyll)
/Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:184:in `require_relative'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:184:in `setup'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:102:in `process'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `block in start'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `each'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `start'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/exe/jekyll:15:in `<top (required)>'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/bin/jekyll:23:in `load'
    from /Users/dillonbarnes/Documents/GitHub/dbarnes18/gh-pages/vendor/bundle/ruby/3.0.0/bin/jekyll:23:in `<top (required)>'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:63:in `load'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:63:in `kernel_load'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:28:in `run'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:494:in `exec'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:30:in `dispatch'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:24:in `start'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/exe/bundle:49:in `block in <top (required)>'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/gems/bundler-2.2.17/exe/bundle:37:in `<top (required)>'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/bin/bundle:23:in `load'
    from /Users/dillonbarnes/.gem/ruby/3.0.0/bin/bundle:23:in `<main>'
dillonbarnes@Downstairs-iMac gh-pages % 

谁能告诉我如何解决这个问题?

提前谢谢你。

我应该补充一点,我在我的 Mac 上没有管理员/sudo 权限。

【问题讨论】:

  • 欢迎堆栈溢出,请尝试在此处发布相关内容/错误,这样我们就不必向下链接了。
  • 我已将日志放入消息中并删除了 GitHub Gist 链接。
  • 查看此链接github.com/jekyll/jekyll/issues/8523。您需要将gem webrick 添加到文件夹中的新Gemfilebundle add webrick
  • 谢谢。成功了!

标签: macos github terminal jekyll github-pages


【解决方案1】:

查看此链接https://github.com/jekyll/jekyll/issues/8523。 您需要将 gem webrick 添加到文件夹中的新 Gemfile 或 bundle add webrick.

这将使jekyll 可以访问它需要的包。

【讨论】:

  • 在你的答案中添加答案描述,实际上,你的帖子不是答案,而是评论。那时您应该收集声望达到 50 并且能够编写 cmets,但现在您的代表已超过 50,请编辑您的答案以提高质量。
  • 另一件事。在我们的回答中不要提及任何人,尤其是在致谢时。这是一个答案,应该指导社区的其他用户。如果你想说谢谢,你应该改用 cmets。
猜你喜欢
  • 2017-11-12
  • 2013-06-26
  • 2016-08-30
  • 2018-04-01
  • 2019-02-19
  • 2013-02-19
  • 1970-01-01
  • 2020-12-04
  • 2016-07-31
相关资源
最近更新 更多