Starefossen / docker-github-pages

:octocat: :whale: Alpine Docker Image for GitHub Pages and Jekyll powered sites
https://registry.hub.docker.com/u/starefossen/github-pages/
MIT License
191 stars 54 forks source link

(Bundler::LockfileError) #68

Open kerolloz opened 4 years ago

kerolloz commented 4 years ago

running docker run -it --rm -v "$PWD":/usr/src/app -p "4000:4000" starefossen/github-pages results in

Traceback (most recent call last):
        13: from /usr/local/bundle/bin/jekyll:23:in `<main>'
        12: from /usr/local/bundle/bin/jekyll:23:in `load'
        11: from /usr/local/bundle/gems/jekyll-3.8.5/exe/jekyll:11:in `<top (required)>'
        10: from /usr/local/bundle/gems/jekyll-3.8.5/lib/jekyll/plugin_manager.rb:50:in `require_from_bundler'
         9: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler.rb:101:in `setup'
         8: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler.rb:135:in `definition'
         7: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/definition.rb:35:in `build'
         6: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/dsl.rb:13:in `evaluate'
         5: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/dsl.rb:218:in `to_definition'
         4: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/dsl.rb:218:in `new'
         3: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/definition.rb:84:in `initialize'
         2: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/definition.rb:84:in `new'
         1: from /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/lockfile_parser.rb:95:in `initialize'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
dellagustin commented 4 years ago

I have just tried out this image and faced the same issue.

dellagustin commented 4 years ago

This seems to be a duplicate of #61

kerolloz commented 4 years ago

Just remove gem lock file

dellagustin commented 4 years ago

thanks, I'll try that, seems to make sense, based on https://stackoverflow.com/questions/56261127/is-the-gemfile-lock-file-needed-in-a-jekyll-site-hosted-with-github-pages

dellagustin commented 4 years ago

It moved forward, but immemorially stumbled on the next error: Could not find gem 'jekyll-feed (~> 0.12)' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)

This is a freshly generated site with jekyll new

dellagustin commented 4 years ago

Ok, nevermind, I commented every other gem installation from the Gemfile that was not the github-pages.

I understand that actually the Gemfile is not even necessary (if I got it correctly) when running with this docker image or pushing it to github, but I wanted to have it for contributors that want to set the development environment locally without docker.

Removing the jekyll-feed gem makes sense since it is already included in the github-pages gem, but the following lines look like they may make sense for the people running it native in some platforms, and they cause conflict with this docker image:

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
  gem "tzinfo", "~> 1.2"
  gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?