簡體   English   中英

添加 Gemfile 時 Jekyll gem 損壞

[英]Jekyll gem breaks when adding Gemfile

我在 jekyll 中有我的網站。 一切正常,直到我做了一些事情(不確定是什么)並且安裝壞了。

我已經在 Ubuntu WSL 和 Windows 本機 ruby​​ 上嘗試過這個,問題是一樣的。 我可以很好地安裝寶石。 並且 jekyll 運行正常,但是如果我添加 gemfile 並再次運行 jekyll(在該文件夾中bundle exec jekyll -v甚至jekyll -v ),jekyll 運行良好,如果我刪除 Gemfile,jekyll 也會運行。

錯誤是:

bundle exec jekyll -v
Traceback (most recent call last):
        23: from C:/tools/ruby26/bin/jekyll:23:in `<main>'
        22: from C:/tools/ruby26/bin/jekyll:23:in `load'
        21: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>'
        20: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:53:in `require_from_bundler'
        19: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler.rb:174:in `require'
        18: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:58:in `require'
        17: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:58:in `each'
        16: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:69:in `block in require'         15: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:69:in `each'
        14: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
        13: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:74:in `require'
        12: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/jekyll-thumb-0.2.1/lib/jekyll-thumb.rb:1:in `<top (required)>'        11: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/jekyll-thumb-0.2.1/lib/jekyll-thumb.rb:1:in `require'
        10: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/jekyll-thumb-0.2.1/lib/jekyll/thumb.rb:2:in `<top (required)>'         9: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/jekyll-thumb-0.2.1/lib/jekyll/thumb.rb:2:in `require'
         8: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/jekyll-thumb-0.2.1/lib/jekyll/thumb/tag.rb:1:in `<top (required)>'
         7: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/jekyll-thumb-0.2.1/lib/jekyll/thumb/tag.rb:1:in `require'              6: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/ruby-vips-2.0.16/lib/ruby-vips.rb:1:in `<top (required)>'              5: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/ruby-vips-2.0.16/lib/ruby-vips.rb:1:in `require'
         4: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/ruby-vips-2.0.16/lib/vips.rb:36:in `<top (required)>'
         3: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/ruby-vips-2.0.16/lib/vips.rb:45:in `<module:GLib>'
         2: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/ffi-1.11.3-x64-mingw32/lib/ffi/library.rb:99:in `ffi_lib'              1: from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/ffi-1.11.3-x64-mingw32/lib/ffi/library.rb:99:in `map'
block in ffi_lib: Could not  (LoadError) 'libglib-2.0-0.dll': Not found

(在 WSL 上完全相同,除了它是libglib-2.0-0.so

我的 gemfile 是這樣的:

source "https://rubygems.org"

# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-paginate-v2"
  gem "jekyll-sitemap"
  gem "jekyll-org"
  gem "jekyll-thumb"
  gem "flickraw"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

根據我得出的結論,在提供 Gemfile 時,jekyll 的版本(或其依賴項)在某種程度上已損壞,但是當我查看捆綁程序的輸出時,它是手動安裝的全局 gem。 我什至嘗試將 libglib-2.0-0.dll 放入 system32 目錄。

軟件包版本:

ruby: 2.6.5 [x64-mingw32]
bundler: 2.1.2
gem: 3.0.3
jekyll: 4.0.0

您在 Gemfile 中運行的 Jekyll 版本存在問題。 您在本地擁有的那個正在工作,所以這是您可以嘗試的。 在 jekyll 失敗的目錄運行jekyll -v 將 Gemfile 中的版本替換為輸出和bundle install

我認為這應該有效。

編輯:您需要像這樣將 jekyll gem 放入您的 Gemfile 中: gem "jekyll"

否則,您應該嘗試安裝它說缺少libglib 包

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM