依赖错误:啧啧!看起来您没有安装 _plugins/lunrjs/jekyll_lunr_js_search.rb 或其依赖项之一



使用插件编译Jekyll项目时,Jekyll_lunr_js_search总是在Windows中遇到以下错误。但是,它在gitlabci上编译。

依赖关系错误:yikes!看来您没有d:/myproject/_plugins/lunrjs/jekyll_lunr_js_search.rb或已安装的依赖项之一。为了使用当前配置的Jekyll,您需要安装此GEM。Ruby的完整错误消息是:"无法加载此类文件-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.
>>>

如果您查看lib目录,您会发现Ruby文件是jekyll-lunr-js-search.rb而不是jekyll_lunr_js_search.rb。此外,它也可以作为RubyGem软件包。

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

最新更新