问题
I use Jekyll to blog using GitHub pages. I have had a problem when running $ bundle exec jekyll serve
or jekyll serve
and the console prints:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ffi-1.9.18-x64-mingw32/lib/ffi/library.rb:147:in `block in ffi_lib': Could not op (LoadError)libcurl': The specified module could not be found.
.
Could not open library 'libcurl.dll': The specified module could not be found.
.
Could not open library 'libcurl.so.4': The specified module could not be found.
.
Could not open library 'libcurl.so.4.dll': The specified module could not be found.
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ffi-1.9.18-x64-mingw32/lib/ffi/library.rb:100:in `map'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ffi-1.9.18-x64-mingw32/lib/ffi/library.rb:100:in `ffi_lib'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon/curls/settings.rb:6:in `<module:Curl>'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon/curls/settings.rb:2:in `<module:Ethon>'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon/curls/settings.rb:1:in `<top (required)>'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon/curl.rb:27:in `require'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon/curl.rb:27:in `<module:Curl>'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon/curl.rb:13:in `<module:Ethon>'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon/curl.rb:8:in `<top (required)>'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon.rb:15:in `require'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.10.1/lib/ethon.rb:15:in `<top (required)>'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:82:in `require'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:77:in `each'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:77:in `block in require'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:66:in `require'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler.rb:108:in `require'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.4.3/lib/jekyll/plugin_manager.rb:37:in `require_from_bundler'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.4.3/exe/jekyll:9:in `<top (required)>'
from C:/Ruby24-x64/bin/jekyll:22:in `load'
from C:/Ruby24-x64/bin/jekyll:22:in `<main>'
What could possibly going wrong? This happens when I change the Gemfile
dependency to gem 'jekyll', '3.4.3'
Below is the content of my Gemfile
:
source "https://rubygems.org"
gem 'jekyll', '3.4.3'
group :jekyll_plugins do
gem 'github-pages'
gem 'i18n', '0.8.4'
gem 'minitest', '5.10.2'
gem 'thread_safe', '0.3.6'
gem 'public_suffix', '2.0.5'
gem 'net-dns', '0.8.0'
gem 'multipart-post', '2.0.0'
gem 'ffi', '1.9.18'
gem 'colorator', '1.1.0'
gem 'sass', '3.4.24'
gem 'rb-fsevent', '0.9.8'
gem 'kramdown', '1.13.2'
gem 'liquid', '3.0.6'
gem 'mercenary', '0.3.6'
gem 'forwardable-extended', '2.6.0'
gem 'rouge', '1.11.1'
gem 'safe_yaml', '1.0.4'
gem 'coffee-script-source', '1.12.2'
gem 'execjs', '2.7.0'
gem 'mini_portile2', '2.2.0'
gem 'jekyll-paginate', '1.1.0'
gem 'jekyll-swiss', '0.4.0'
gem 'gemoji', '3.0.0'
gem 'unicode-display_width', '1.2.1'
gem 'bundler', '1.15.1'
gem 'tzinfo', '1.2.3'
gem 'addressable', '2.5.1'
gem 'faraday', '0.12.1'
gem 'ethon', '0.10.1'
gem 'rb-inotify', '0.9.10'
gem 'jekyll-sass-converter', '1.5.0'
gem 'pathutil', '0.14.0'
gem 'coffee-script', '2.4.1'
gem 'nokogiri', '1.8.0'
gem 'terminal-table', '1.8.0'
gem 'activesupport', '4.2.8'
gem 'sawyer', '0.8.1'
gem 'typhoeus', '0.8.0'
gem 'listen', '3.0.6'
gem 'jekyll-coffeescript', '1.0.1'
gem 'html-pipeline', '2.6.0'
gem 'octokit', '4.7.0'
gem 'jekyll-watch', '1.5.0'
gem 'github-pages-health-check', '1.3.4'
gem 'jekyll-gist', '1.4.0'
gem 'jekyll-avatar', '0.4.2'
gem 'jekyll-default-layout', '0.1.4'
gem 'jekyll-feed', '0.9.2'
gem 'jekyll-github-metadata', '2.3.1'
gem 'jekyll-mentions', '1.2.0'
gem 'jekyll-optional-front-matter', '0.1.2'
gem 'jekyll-readme-index', '0.1.0'
gem 'jekyll-redirect-from', '0.12.1'
gem 'jekyll-relative-links', '0.4.0'
gem 'jekyll-seo-tag', '2.2.3'
gem 'jekyll-sitemap', '1.0.0'
gem 'jekyll-theme-architect', '0.0.4'
gem 'jekyll-theme-cayman', '0.0.4'
gem 'jekyll-theme-dinky', '0.0.4'
gem 'jekyll-theme-hacker', '0.0.4'
gem 'jekyll-theme-leap-day', '0.0.4'
gem 'jekyll-theme-merlot', '0.0.4'
gem 'jekyll-theme-midnight', '0.0.4'
gem 'jekyll-theme-minimal', '0.0.4'
gem 'jekyll-theme-modernist', '0.0.4'
gem 'jekyll-theme-primer', '0.2.1'
gem 'jekyll-theme-slate', '0.0.4'
gem 'jekyll-theme-tactile', '0.0.4'
gem 'jekyll-theme-time-machine', '0.0.4'
gem 'jekyll-titles-from-headings', '0.1.5'
gem 'jemoji', '0.8.0'
gem 'minima', '2.1.1'
end
Thank you very much!
回答1:
It seems you don't have libcurl which is probably a dependency of this version of Jekyll or one of it's dependencies. Can you try installing it via https://curl.haxx.se/dlwiz/?type=lib?
回答2:
Running Ubuntu on top of Win 10, I found this did the trick for me:
sudo apt-get install libcurl4-gnutls-dev
来源:https://stackoverflow.com/questions/44618581/could-not-open-library-libcurl-so-4-when-running-bundle-exec-jekyll-serve