jekyll服务依赖错误 – 无法打开’lib curl’
我试图运行bundle exec jekyll serve
但是它出现了错误:
Dependency Error: Yikes! It looks like you don't have jekyll-remote-theme or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'Could not open library '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. ' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/! jekyll 3.6.2 | Error: jekyll-remote-theme
所以我检查了是否安装了curl:
$ curl --version curl 7.50.1 (x86_64-w64-mingw32) libcurl/7.50.1 OpenSSL/1.0.2h zlib/1.2.8 libidn/1.33 libssh2/1.7.0 nghttp2/1.13.0 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp Features: IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP HTTP2 Metalink
我搜索过类似的问题,但解决方案似乎与我的问题无关。 我是Jekyll和Ruby的新手,我只是希望能够离线查看我的Github页面。
我使用的是Windows 7 64位。 任何建议,将不胜感激!
我有同样的问题。 它似乎来自Ruby-FFI ,如此处所述。
关于jekyll-remote-theme
的依赖关系,我得到了与你相同的错误。 其中一种是使用FFI的typhoeus
。 此外,执行github-pages health-check
显示此错误:
ffi-1.9.18-x64-mingw32/lib/ffi/library.rb:147:in `block in ffi_lib': Could not open libra (LoadError): 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.
它可能不是’正确’的方式,但有效的解决方案是从这里的一个软件包中获取libcurl.dll
: https : //curl.haxx.se/gknw.net/7.40.0/dist-w64/把它放在PATH上。
不起作用的事情包括:
- 将PATH从当前的Curl下载向导中获取的
cygcurl-4.dll
放在PATH上 - 将上面的
cygcurl-4.dll
重命名为libcurl.dll
并将其放在PATH上 - 安装
msys2
软件包libcurl-devel 7.57.0-1
- 将
msys-curl-4.dll
(从msys64\usr\bin
找到的msys64\usr\bin
)重命名为libcurl.dll
没试过:
-
从最新的源代码构建curl / libcurl。 因为我已经根据
pacman -Ss libcurl
获得了最新信息:msys/libcurl 7.57.0-1 (libraries) [installed] Multi-protocol file transfer library (runtime)
msys/libcurl-devel 7.57.0-1 (development) [installed] Libcurl headers and libraries
我的工作是省略Gemfile中的Jekyll插件。
原始Gemfile:
source 'https://rubygems.org' gem 'github-pages', group: :jekyll_plugins
新:
source 'https://rubygems.org' gem 'github-pages'
但是,如果您需要使用插件,请查看以下TT–的答案。 我不能让它自己工作,但它是完全相同的问题,所以如果它对他有效,我想它应该工作。
我有同样的问题。 我的解决方案是TT–,但我把下载的文件libcurl.dll
放在这里:
C:\Ruby24-x64\bin
任何其他文件夹都给我带来了相同的错误,即使它在PATH中。
我看到的问题是混合使用bundle和gem命令,考虑到你的Jekyll根路径中只有github-pages gem的Gemfile,请执行以下操作:
bundle install bundle exec jekyll serve
这应该创建一个包含所有必需依赖项的文件夹,然后执行新安装的Jekyll版本。