Jekyll无法提供服务(Ruby不兼容的库版本)

时间:2016-04-24 21:12:46

标签: ruby jekyll

尝试运行jekyll serve时,它似乎正确构建(虽然警告说我无法解决),但随后无法提供服务。 jekyll build完成,但生成的文件缺少已编译的CSS。

jekyll serve的输出:

Ignoring ffi-1.9.10 because its extensions are not built.  Try: gem pristine ffi --version 1.9.10
Ignoring curb-0.9.3 because its extensions are not built.  Try: gem pristine curb --version 0.9.3
Ignoring executable-hooks-1.3.2 because its extensions are not built.  Try: gem pristine executable-hooks --version 1.3.2
Ignoring ffi-1.9.10 because its extensions are not built.  Try: gem pristine ffi --version 1.9.10
Ignoring gem-wrappers-1.2.7 because its extensions are not built.  Try: gem pristine gem-wrappers --version 1.2.7
Ignoring json-1.8.2 because its extensions are not built.  Try: gem pristine json --version 1.8.2
Ignoring thin-1.6.1 because its extensions are not built.  Try: gem pristine thin --version 1.6.1
Configuration file: /home/jtebert/OwnCloud/Projects/Programming/python/AMS/mockup/_config.yml
            Source: /home/jtebert/OwnCloud/Projects/Programming/python/AMS/mockup
       Destination: /home/jtebert/OwnCloud/Projects/Programming/python/AMS/mockup/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 1.404 seconds.
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': incompatible library version - /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/ffi-1.9.10/lib/ffi_c.so (LoadError)
        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/ffi-1.9.10/lib/ffi.rb:6:in `rescue in <top (required)>'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/ffi-1.9.10/lib/ffi.rb:3:in `<top (required)>'
        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/rb-inotify-0.9.7/lib/rb-inotify/native.rb:1:in `<top (required)>'
        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/rb-inotify-0.9.7/lib/rb-inotify.rb:1:in `<top (required)>'
        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/linux.rb:30:in `_configure'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/base.rb:45:in `block in configure'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/base.rb:40:in `each'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/base.rb:40:in `configure'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/base.rb:63:in `start'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/backend.rb:26:in `start'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/listener.rb:67:in `block in <class:Listener>'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/fsm.rb:120:in `instance_eval'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/fsm.rb:120:in `call'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/fsm.rb:57:in `transition'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/listener.rb:90:in `start'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-watch-1.3.1/lib/jekyll/watcher.rb:12:in `watch'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-3.1.3/lib/jekyll/commands/build.rb:72:in `watch'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-3.1.3/lib/jekyll/commands/build.rb:39:in `process'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-3.1.3/lib/jekyll/commands/serve.rb:34:in `block (2 levels) in init_with_program'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
        from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-3.1.3/bin/jekyll:13:in `<top (required)>'
        from /usr/local/bin/jekyll:23:in `load'
        from /usr/local/bin/jekyll:23:in `<main>'

在尝试启动Jekyll项目时,我确实需要创建Ruby版本的链接,因为它正在寻找Ruby2.1&#39;但是我不确定这是否正在播放当前问题中的角色:ln -s /usr/bin/ruby '/usr/bin/ruby2.1'

据我的包管理员说,我已经安装了Ruby 2.3.0。但根据which ruby,我使用的是2.0.0,它来自rvm:/home/xxxxxxx/.rvm/rubies/ruby-2.0.0-p643/bin/ruby。正如我之前提到的,Jekyll似乎想要v2.1。我猜测这些冲突的版本会以某种方式导致问题,但我不知道如何解决它。

2 个答案:

答案 0 :(得分:0)

对我来说问题似乎是rvm(我不知道我最终是如何使用的)。解决方案是使用rvm implode删除rvm,然后使用gem install jekyll重新安装jekyll。警告和错误都消失了,而且服务正常。

答案 1 :(得分:0)

在我的情况下,我必须使用 {{ HTML::row() }} {{ HTML::col(3,3,3,3) }} {{ Form::formGroup() }} {{ Form::label('RecordID', 'Record ID') }} {{ Form::text('RecordID', $Appinfo->RecordID, ['class' => 'form-control', 'data-fv-notempty' => 'true', 'readonly']) }} {{ Form::closeFormGroup() }} {{ HTML::closeCol() }} {{ Form::formGroup()}} {{ HTML::closeRow() }} 安装ffi库:

gem

此错误可能是由系统中安装的旧版本库引起的。 gem install ffi然后为您的项目安装正确的版本。