New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually requiring jekyll-remote-theme if and only if a remote_theme is requested in the user config #509

Closed
cetinajero opened this Issue Dec 20, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@cetinajero

cetinajero commented Dec 20, 2017

Before submitting an issue, please be sure to

This issue affects

  • The site generated by GitHub Pages
  • Building sites locally

What did you do (e.g., steps to reproduce)

We are having some side effects from #499 merged PR that was shipped on pages-gem v171. We aren't currently using jekyll-remote-theme gem neither including the remote_theme key on our _config.yml files but even with this... we are having side effects due to dependencies from v171 gem related to libcurl and we aren't able to compile our sites on Windows machines.

I had tested v171 and v172 on macOS and works just fine because curl comes right-out-the-box but we have some web designers colleagues (that doesn't understand anything of this) working locally on Windows that aren't able to compile anymore their repos due to this dependency problem.

When they exec bundle exec jekyll serve on Windows and the Gemfile has gem 'github-pages', '170', group: :jekyll_plugins they generate the site successfully.

When they exec bundle exec jekyll serve on Windows and the Gemfile has gem 'github-pages', '171', group: :jekyll_plugins Jekyll throws an error demanding libcurl due to the inclusion of jekyll-remote-theme enabled by default (PR #499 on pages-gem v171), it was tested on Win 7, 8 and 10.

What did you expect to happen?

Everything goes smooth as always on both platforms at the latest pages-gem version and the inclusion of a now-hardcode-enabled-but-not-critical-plugin doesn't breaks Jekyll site generation.

We know that the inclusion of the jekyll-remote-theme gem will be very helpful for a lot of folks (actually we now plan to create our on Jekyll-theme gem thanks to the inclusion of jekyll-remote-theme to GitHub Pages) but it is also causing this side-effects for others who are on windows and suddenly they aren't able to compile their sources by a plugin dependency that aren't even using.

What happened instead?

A libcurl error related to jekyll-remote-theme that comes like this:

 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

The output of github-pages healt-check:

(LoadError)4/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 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.
       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.11.0/lib/ethon/curls/settings.rb:7:in `<module:Curl>'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.11.0/lib/ethon/curls/settings.rb:2:in `<module:Ethon>'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.11.0/lib/ethon/curls/settings.rb:1:in `<top (required)>'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.11.0/lib/ethon/curl.rb:27:in `<module:Curl>'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.11.0/lib/ethon/curl.rb:13:in `<module:Ethon>'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.11.0/lib/ethon/curl.rb:8:in `<top (required)>'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ethon-0.11.0/lib/ethon.rb:15:in `<top (required)>'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:in `require'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:in `require'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/typhoeus-0.8.0/lib/typhoeus.rb:2:in `<top (required)>'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/github-pages-health-check-1.3.5/lib/github-pages-health-check.rb:9:in `<top (required)>'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
       from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/github-pages-172/bin/github-pages:44:in `block (3 levels) in <top (required)>'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
       from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/github-pages-172/bin/github-pages:6:in `<top (required)>'
       from C:/Ruby24-x64/bin/github-pages:23:in `load'
       from C:/Ruby24-x64/bin/github-pages:23:in `<main>'

Temporary solutions

I know we could just install the cUrl library on every Windows machine but it seems as an unnecessary action because we aren't using this gem currently.

You can see some temporary solutions from several reports of this issue here:

What we made is just stick Windows users on v170 using this snippet as a temporally solution:

if Gem.win_platform?
  gem 'github-pages', '170', group: :jekyll_plugins
else
  gem 'github-pages', group: :jekyll_plugins
end

What will be ideal

We want to find an elegant solution besides physically installing curl on every Windows machine even when the plugin isn't been used at all.

Following conversation on PR #499 with @benbalter, you can see that he thought on a very elegant solution on this comment

@parkr what do you think about manually requiring jekyll remote theme in https://github.com/github/pages-gem/blob/master/lib/github-pages/configuration.rb#L143-L148 if and only if a remote theme is requeted in the user config?

hochleitner added a commit to Playful-Interactive-Environments/gamejam that referenced this issue Dec 30, 2017

Updated Gemfile and Gemfile.lock
Updated all gems and fixed github-pages to version 170 to resolve the issue described in github/pages-gem#509

rajsite added a commit to rajsite/rajsite.com that referenced this issue Jan 14, 2018

Update github-pages but avoid latest
Latest breaks on Windows and it's difficult to get workarounds for
making libcurl discoverable to Ruby (some systems used RailsInstaller
others manually set-up Ruby and DevKit). Hold-off on latest until
following fixed github/pages-gem#509

StefanBrand added a commit to junge-pfarre/junge-pfarre.github.io that referenced this issue Jan 15, 2018

Füge Gemfile für lokale Tests hinzu
Dieses Gemfile wird benötigt, um lokale Tests unter denselben (ähnlichen?
Bedingungen wie auf Github Pages durchzuführen).

Referenz: https://jekyllrb.com/docs/github-pages/#the-github-pages-gem

Aufgrund eines Bugs, dessen Fix noch nicht gemerged wurde, müssen wir die
`jekyll-plugins`-Gruppe fürs erste weglassen. Die Auswirkungen sind mir
im Moment nicht bewusst. Details:

- github/pages-gem#509
- https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md#the-jekyll_plugins-group

StefanBrand added a commit to junge-pfarre/junge-pfarre.github.io that referenced this issue Jan 15, 2018

Füge Gemfile für lokale Tests hinzu
Dieses Gemfile wird benötigt, um lokale Tests unter denselben (ähnlichen?
Bedingungen wie auf Github Pages durchzuführen).

Referenz: https://jekyllrb.com/docs/github-pages/#the-github-pages-gem

Aufgrund eines Bugs, dessen Fix noch nicht gemerged wurde, müssen wir die
`jekyll-plugins`-Gruppe fürs erste weglassen. Die Auswirkungen sind mir
im Moment nicht bewusst. Details:

- github/pages-gem#509
- https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md#the-jekyll_plugins-group

StefanBrand added a commit to junge-pfarre/junge-pfarre.github.io that referenced this issue Jan 19, 2018

Hinzufügen des Gemfile für lokale Tests
Dieses Gemfile wird benötigt, um lokale Tests unter denselben (ähnlichen?
Bedingungen wie auf Github Pages durchzuführen).

Referenz: https://jekyllrb.com/docs/github-pages/#the-github-pages-gem

Aufgrund eines Bugs, dessen Fix noch nicht gemerged wurde, müssen wir die
`jekyll-plugins`-Gruppe fürs erste weglassen. Die Auswirkungen sind mir
im Moment nicht bewusst. Details:

- github/pages-gem#509
- https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md#the-jekyll_plugins-group
@realchrisolin

This comment has been minimized.

Show comment
Hide comment
@realchrisolin

realchrisolin Jan 23, 2018

For those using Cygwin, Gem.win_platform? isn't going to work here. I came up with the following workaround:

        if Gem.platforms[1].os == "cygwin"
                gem "github-pages", "170"
        else
                gem "github-pages", ">=173"
        end

Don't forget to add the group as necessary.

EDIT: Further tinkering led me to http://devadraco.blogspot.com/2016/08/running-wpscan-on-cygwin.html. Even though the application is entirely different, the manual fix for ethon is just as applicable here. I was able to use it to get libcurl/jekyll-remote-theme working in a cygwin environment.

realchrisolin commented Jan 23, 2018

For those using Cygwin, Gem.win_platform? isn't going to work here. I came up with the following workaround:

        if Gem.platforms[1].os == "cygwin"
                gem "github-pages", "170"
        else
                gem "github-pages", ">=173"
        end

Don't forget to add the group as necessary.

EDIT: Further tinkering led me to http://devadraco.blogspot.com/2016/08/running-wpscan-on-cygwin.html. Even though the application is entirely different, the manual fix for ethon is just as applicable here. I was able to use it to get libcurl/jekyll-remote-theme working in a cygwin environment.

@benbalter benbalter closed this in 315c509 Jan 23, 2018

@cetinajero

This comment has been minimized.

Show comment
Hide comment
@cetinajero

cetinajero Jan 23, 2018

Thanks for all your effort and help @benbalter! Regards ✌️

cetinajero commented Jan 23, 2018

Thanks for all your effort and help @benbalter! Regards ✌️

StefanBrand added a commit to junge-pfarre/junge-pfarre.github.io that referenced this issue Jan 29, 2018

Aktualisierung des Gemfile und der _config.yml
Dieser Bug ist gefixt: github/pages-gem#509

Jekyll hat mein `git remote origin` nicht erkannt, also musste ich auch
unser Repository definieren. Das muss bei einer Änderung des Repository-
Namens (siehe #1) auch geändert werden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment