2

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!

Leeton
  • 51
  • 7
  • v171 of the github pages gem added jekyll-remote-theme as a dependency. Please see the official issue here: https://github.com/github/pages-gem/issues/509 – Johannes Jan 10 '18 at 23:03
  • The error is issue #17 at the jekyll-remote-theme repository: https://github.com/benbalter/jekyll-remote-theme/issues/17 – koppor Jan 21 '18 at 14:53
  • Possible duplicate of [How to solve 'libcurl' not found with Rails on Windows](https://stackoverflow.com/questions/39377541/how-to-solve-libcurl-not-found-with-rails-on-windows) – TT-- Jan 30 '19 at 14:54

4 Answers4

4

Here's what worked for me:

(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.

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 to libcurl.dlland putting it on the PATH
  • Installing the msys2 package libcurl-devel 7.57.0-1
  • Renaming the msys-curl-4.dll (from msys2 found at msys64\usr\bin) to libcurl.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

TT--
  • 2,956
  • 1
  • 27
  • 46
  • I used the package [curl-7.40.0-devel-mingw64.zip](https://curl.haxx.se/gknw.net/7.40.0/dist-w64/curl-7.40.0-devel-mingw64.zip), therein the path `curl-7.40.0-devel-mingw64\bin`. It worked. Thank you! – koppor Jan 21 '18 at 13:08
  • In 2021, this is still the most detailed and effective answer. Be careful though, the link to curl/haxx.se is confusing. The only link that gave me a downloadable file (without installing over CLI) was the link pointing to `the curl project`s download site – Eric Steinborn Dec 09 '21 at 14:40
3

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.

cdelfierro
  • 69
  • 1
  • 4
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.

Leeton
  • 51
  • 7
  • This is exactly what I told you in my answer, just include gihub-pages gem. – marcanuy Dec 12 '17 at 21:22
  • Yeah I suppose, I just wanted to clarify and make the answer as simple as possible, so people who are new to Jekyll like me can understand. If you want to edit your answer to be as clear as mine I can delete my answer and re-mark you as the solution if you want. – Leeton Dec 13 '17 at 17:27
  • ty, after removing the group the error is gone. Can you explain me what's the difference now? – Daniel P. Jan 20 '18 at 23:08
-1

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.

marcanuy
  • 23,118
  • 9
  • 64
  • 113
  • Ah, thanks. I had the Gemfile containing: `source 'https://rubygems.org' gem 'github-pages', group: :jekyll_plugins` and removed the ", group: :jekyll_plugins" part and it worked. – Leeton Dec 11 '17 at 13:12
  • @Leeton, well that is one way to do it, since you have removed the dependency on jekyll-remote-theme and therefore on libcurl, but according to https://pages.github.com/versions, those are `github-pages` dependencies – TT-- Dec 11 '17 at 14:05
  • @TT-- Oh I see. Well it seems to be fine without it. I tried your solution but it doesn't seem to change anything. I might have done it wrong but I added C:/users//libcurl to PATH (for some reason) with libcurl.dll found at that directory. – Leeton Dec 11 '17 at 14:59
  • assuming has no spaces, you may have to restart your terminal session (or computer) so that the updated PATH is used – TT-- Dec 11 '17 at 15:04