Создайте локальный гем для Jekyll и продолжайте получать «не устанавливайте jekyll-custom-plugin или одну из его зависимостей», так как jekyll не может его найти - PullRequest
0 голосов
/ 26 апреля 2020

Я создаю новый и пользовательский гем под названием " jekyll-custom-plugin " для моего Jekyll, и гем успешно создается.

robbi@pc MINGW64 /d/Workplace/ruby/jekyll-custom-plugin(master)
$ gem build  jekyll-custom-plugin.gemspec
  Successfully built RubyGem
  Name:  jekyll-custom-plugin
  Version: 1.0.3
  File:  jekyll-custom-plugin-1.0.3.gem

Я открываю и изменяю свой gemfile плагин с указанием пути к файлу и версии файла

group :jekyll_plugins do
  # put here other jekyll plugins..
    gem 'jekyll-custom-plugin', '1.0.3', :path => 'd:/Workplace/ruby/jekyll-custom-plugin'
end

и мой jekyll _config.yml вызывают плагин как обычно

plugins:
  - jekyll-custom-plugin

но когда я пытаюсь собрать веб-сайт (bundle update, bundle install и bundle exec jekylly serve), я продолжаю получать

robbi@pc MINGW64 /d/NOPE/robbinespu.gitlab.io (master)
$ bundle exec jekyll serve
Configuration file: D:/NOPE/robbinespu.gitlab.io/_config.yml
 Theme Config file: C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/octoflavor-ee4be458ed67/_config.yml
  Dependency Error: Yikes! It looks like you don't have jekyll-custom-plugin or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. If you've run Jekyll with `bundle exec`, ensure that you have included the jekyll-custom-plugin gem in your Gemfile as well. The full error message from Ruby is: 'cannot load such file -- jekyll-custom-plugin' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
                    ------------------------------------------------
      Jekyll 4.0.0   Please append `--trace` to the `serve` command
                     for any additional information or backtrace.
                    ------------------------------------------------

Это weid, потому что, я уже установил, и он появляется здесь

robbi@pc MINGW64 /d/NOPE/robbinespu.gitlab.io (master)
$ bundle install | grep custom
Using jekyll-custom-plugin 1.0.3 from source at `d:/Workplace/ruby/jekyll-custom-plugin`

robbi@pc MINGW64 /d/NOPE/robbinespu.gitlab.io (master)
$ bundle info jekyll-custom-plugin
  * jekyll-custom-plugin (1.0.3)
        Summary: A Jekyll plugin to provide XXX.
        Homepage: https://github.com/robbinespu/XXX
        Path: d:/Workplace/ruby/jekyll-custom-plugin

даже пакет сказал, что он уже установлен и соответствует версии

robbi@pc MINGW64 /d/NOPE/robbinespu.gitlab.io (master)
$ bundle list | custom
  * jekyll-custom-plugin (1.0.3)

здесь --trace log

$ bundle exec jekyll s --trace
Configuration file: D:/NOPE/robbinespu.gitlab.io/_config.yml
 Theme Config file: C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/octoflavor-ee4be458ed67/_config.yml
  Dependency Error: Yikes! It looks like you don't have jekyll-custom-plugin or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. If you've run Jekyll with `bundle exec`, ensure that you have included the jekyll-custom-plugin gem in your Gemfile as well. The full error message from Ruby is: 'cannot load such file -- jekyll-custom-plugin' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:73:in `rescue in block in require_with_graceful_fail': jekyll-custom-plugin (Jekyll::Errors::MissingDependencyException)
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:58:in `block in require_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:57:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:57:in `require_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/plugin_manager.rb:30:in `require_gems'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/plugin_manager.rb:22:in `conscientious_require'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/site.rb:125:in `setup'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/site.rb:35:in `initialize'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/build.rb:30:in `new'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/build.rb:30:in `process'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/exe/jekyll:15:in `<top (required)>'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `load'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `<main>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:60:in `require': cannot load such file -- jekyll-custom-plugin (LoadError)
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:60:in `block in require_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:57:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:57:in `require_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/plugin_manager.rb:30:in `require_gems'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/plugin_manager.rb:22:in `conscientious_require'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/site.rb:125:in `setup'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/site.rb:35:in `initialize'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/build.rb:30:in `new'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/build.rb:30:in `process'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/exe/jekyll:15:in `<top (required)>'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `load'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `<main>'

1 Ответ

0 голосов
/ 26 апреля 2020

Сообщение об исключении не дает (root причина) причину сбоя.

Добавьте --trace, как предложено, изучите файл, который вызывает ошибку, и посмотрите, как возникает эта ошибка. построен Это может происходить по следующей схеме:

    begin
      # ...
    rescue LoadError => e
      raise "Generic error message not including anything from 'e.'"
    end

... в этом случае измените на:

begin
  # ...
rescue LoadError => e
  raise "Error message: #{e.class}: #{e}"
end

... и вы увидите причину root.

Если вам повезло меньше, вы увидите:

if $SOME_GLOBAL_FLAG
  raise "Generic error message"
end

В этом случае флаг устанавливается в другом месте в блоке спасения для LoadError. Вам нужно будет отыскать это спасение и распечатать ошибку оттуда.

В любом случае я лично сообщу об исключении исключения root причиной для библиотеки, которая использует любой шаблон в качестве ошибки.

...