【问题标题】:Dependency Error: Yikes! It looks like you don't have _plugins/lunrjs/jekyll_lunr_js_search.rb or one of its dependencies installed依赖错误:哎呀!看起来您没有安装 _plugins/lunrjs/jekyll_lunr_js_search.rb 或其依赖项之一
【发布时间】:2017-03-08 16:46:17
【问题描述】:

使用插件jekyll_lunr_js_search 编译 Jekyll 项目时,在 windows 中总是出现以下错误。但是它可以在 gitlabci 上编译。

依赖错误:哎呀!看起来您没有安装 D:/myproject/_plugins/lunrjs/jekyll_lunr_js_search.rb 或其依赖项之一。为了使用当前配置的 Jekyll,你需要安装这个 gem。来自 Ruby 的完整错误消息是:'cannot load such file -- v8' 如果遇到问题,可以在 https://jekyllrb.com/help/ 找到有用的资源!

使用gem install jekyll-lunr-js-search时出现以下错误:

C:\MyProj>gem install jekyll-lunr-js-search
Fetching: json-2.0.3.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-2.0.3
Fetching: ref-2.0.0.gem (100%)
Successfully installed ref-2.0.0
Fetching: libv8-3.16.14.19.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll-lunr-js-search:
        ERROR: Failed to build gem native extension.

    current directory: C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8
C:/APPs/Ruby23-x64/bin/ruby.exe -r ./siteconf20170310-14120-1y669dw.rb extconf.rb
creating Makefile
The system cannot find the path specified.
C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/builder.rb:86:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently 3.4.4 (RuntimeError)
        from C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/builder.rb:53:in `build_libv8!'
        from C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:24:in `install!'
        from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19 for inspection.
Results logged to C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/libv8-3.16.14.19/gem_make.out

** 文件内容 (gem_make.out)**

current directory: C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8
C:/APPs/Ruby23-x64/bin/ruby.exe -r ./siteconf20170310-14120-1y669dw.rb extconf.rb
creating Makefile
The system cannot find the path specified.
C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/builder.rb:86:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently 3.4.4 (RuntimeError)
    from C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/builder.rb:53:in `build_libv8!'
    from C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:24:in `install!'
    from extconf.rb:7:in `<main>'

extconf failed, exit code 1

注意: 我已经安装了 python v2 和 v3 并且工作正常。使用py -2 测试的python shell 输出如下:

C:\>py -2
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

【问题讨论】:

  • 你是怎么安装的?
  • 将“jekyll_lunr_js_search.rb”放在 _plugins 文件夹中

标签: jekyll jekyll-extensions


【解决方案1】:

如果您查看 lib 目录,您会看到 ruby​​ 文件是 jekyll-lunr-js-search.rb 而不是 jekyll_lunr_js_search.rb。此外,它还可以作为 Rubygem 包使用。

只需将 gem 添加到 Gemfile 中的 :jekyll_plugins 组,运行 bundle install 并继续使用 Jekyll 构建/服务。

【讨论】:

  • 我重命名了 jekyll-lunr-js-search.rb 文件,该文件对插件功能没有影响,因为已经尝试重命名。 Rubygem 方法也不起作用。错误是一样的
  • 您能否通过bundle installgem install jekyll-lunr-js-search 成功安装插件?
  • 没有失败,我已将输出放在 EDITED 问题中
  • Windows 对libv8 的支持可能要等到Rubyinstaller2 项目提供兼容的DevKit 才能编译libv8 扩展
  • 这个答案帮助我解决了我一直在努力解决的另一个依赖问题——确保你的 .rb 文件与你的包名相同!
猜你喜欢
  • 2016-01-31
  • 2016-12-18
  • 1970-01-01
  • 2015-04-16
  • 2016-08-21
  • 1970-01-01
  • 2019-01-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多