【问题标题】:jekyll 3.0.1 | Error: undefined method `map!' for nil:NilClass杰基尔 3.0.1 |错误:未定义的方法“地图!”对于零:NilClass
【发布时间】:2016-05-05 14:16:51
【问题描述】:

我想更新一个 jekyll 网站 - 但在尝试“jekyll serve”时,我现在得到:

WARN: Unresolved specs during Gem::Specification.reset:
      jekyll-watch (~> 1.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Configuration file: /home/ligi/git/espass.github.io/_config.yml
jekyll 3.0.1 | Error:  undefined method `map!' for nil:NilClass

bundle exec jekyll serve 也会失败

➜  espass.github.io git:(master) ✗ bundle exec jekyll serve 
Configuration file: /home/ligi/git/espass.github.io/_config.yml
jekyll 3.0.1 | Error:  undefined method `map!' for nil:NilClass

有人知道如何追踪这个错误吗?在互联网上找不到任何关于它的信息,我有点卡在这里

编辑:

➜  espass.github.io git:(master) ✗ bundle exec jekyll serve --trace
Configuration file: /home/ligi/git/espass.github.io/_config.yml
/usr/lib/ruby/vendor_ruby/jekyll/configuration.rb:246:in `block in backwards_compatibilize': undefined method `map!' for nil:NilClass (NoMethodError)
    from /usr/lib/ruby/vendor_ruby/jekyll/configuration.rb:238:in `each'
    from /usr/lib/ruby/vendor_ruby/jekyll/configuration.rb:238:in `backwards_compatibilize'
    from /usr/lib/ruby/vendor_ruby/jekyll/configuration.rb:189:in `read_config_files'
    from /var/lib/gems/2.3.0/gems/jekyll-3.0.5/lib/jekyll.rb:101:in `configuration'
    from /usr/lib/ruby/vendor_ruby/jekyll/command.rb:42:in `configuration_from_options'
    from /var/lib/gems/2.3.0/gems/jekyll-3.0.5/lib/jekyll/commands/build.rb:29:in `process'
    from /var/lib/gems/2.3.0/gems/jekyll-3.0.5/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
    from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `block in execute'
    from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `each'
    from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `execute'
    from /usr/lib/ruby/vendor_ruby/mercenary/program.rb:42:in `go'
    from /usr/lib/ruby/vendor_ruby/mercenary.rb:19:in `program'
    from /var/lib/gems/2.3.0/gems/jekyll-3.0.5/bin/jekyll:17:in `<top (required)>'
    from /usr/local/bin/jekyll:23:in `load'
    from /usr/local/bin/jekyll:23:in `<main>'

【问题讨论】:

  • @DavidJacquel 这不是一个重复 - 我的问题不是缺少的 dep 而是 nilpointer
  • 你可以尝试重新安装你的 gems。
  • 在“sudo gem cleanup && bundle install”之后得到同样的错误
  • 任何可用的存储库网址?

标签: jekyll


【解决方案1】:

编辑后的答案:观察你的轨迹,我们可以看到你之间有碰撞

/usr/lib/ruby/vendor_ruby/jekyll/

/var/lib/gems/2.3.0/gems/jekyll-3.0.5/

个人而言,为了避免这种情况,我也选择rbenv

旧答案

如果你使用bundler,你必须用bundle exec jekyll serve启动Jekyll。

我刚刚在您的存储库上对其进行了测试,效果很好。

【讨论】:

  • 我得到了同样的结果:> bundle exec jekyll serve 配置文件:/home/ligi/git/es​​pass.github.io/_config.yml jekyll 3.0.1 |错误:未定义的方法“地图!”对于 nil:NilClass
  • bundle exec jekyll serve --trace ?
  • 将跟踪添加到我的问题中
  • 宝石正在碰撞。更新了我的答案。
  • 感谢您的输入 - 不幸的是,我对 rbenv 也有同样的看法:gist.github.com/ligi/4fd9b76397e3d30da9eb4ef4573572dc 我不经常使用 ruby​​(目前仅适用于 jekyll),所以它可能是我想念的东西 - 赞成但我还不能接受,因为我无法验证
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-06-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多