问题
I am trying to run bundle exec jekyll serve
but it comes up with the error:
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
So I checked if curl was installed:
$ 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
I've searched for similar questions but the solutions don't seem to be relevant to my issue. I'm new to Jekyll and Ruby and I just wanted to be able to view my Github Pages offline.
I am using Windows 7 64-bit. Any suggestions would be appreciated!
回答1:
I had the same problem. My solution was the one of TT--, but I put the downloaded file libcurl.dll
here:
C:\Ruby24-x64\bin
Any other folder got me the same error, even if it was in the PATH.
回答2:
My work around was to omit the Jekyll plugins from the Gemfile.
Original Gemfile:
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
New:
source 'https://rubygems.org'
gem 'github-pages'
However, if you need to use the plugins, check out TT--'s answer below. I couldn't get it working myself, but it is the exact same problem so if it worked for him I guess it should work.
回答3:
Working solution
It's probably not the 'correct' way but this worked for me:
Obtain a
libcurl.dll
from one of the packages here:https://curl.haxx.se/download.html#Win64
(Link was updated, but originally pointed to version
7.40
)Put it on the
PATH
somehow.- (I just put it under
\ruby24\bin\
) - Maybe for you it's
C:\Ruby24-x64\bin
, which others have suggested.
- (I just put it under
About the problem
Seems to be coming from Ruby-FFI. (as described here)
I got the same error above about the dependencies of
jekyll-remote-theme
.(One of them is typhoeus which uses FFI.)
Also, doing a
github-pages health-check
showed this error :
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.
Things I tried that didn't work:
- Putting on the PATH the
cygcurl-4.dll
obtained from the current Curl Download Wizard - Renaming the above
cygcurl-4.dll
tolibcurl.dll
and putting it on the PATH - Installing the
msys2
packagelibcurl-devel 7.57.0-1
- Renaming the
msys-curl-4.dll
(frommsys2
found atmsys64\usr\bin
) tolibcurl.dll
Didn't try:
Building curl / libcurl from the latest source. Because I already had the latest according to
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
回答4:
The problem I see is mixing the usage of bundle and gem commands, considering you have a Gemfile with just the github-pages gem in your Jekyll root path, do this:
bundle install
bundle exec jekyll serve
That should create a folder with all needed dependencies and then execute the newly installed Jekyll version.
来源:https://stackoverflow.com/questions/47720302/jekyll-serve-dependency-error-could-not-open-lib-curl