Skip to content
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

Image for 4.2.2 broken #340

Open
rysiekpl opened this issue May 6, 2022 · 10 comments
Open

Image for 4.2.2 broken #340

rysiekpl opened this issue May 6, 2022 · 10 comments

Comments

@rysiekpl
Copy link

rysiekpl commented May 6, 2022

Docker image for Jekyll 4.2.2 is badly broken. Consider:

$ docker run --rm -v "$PWD:/srv/jekyll/" jekyll/jekyll:4.2.2 jekyll new ./
Unable to find image 'jekyll/jekyll:4.2.2' locally
4.2.2: Pulling from jekyll/jekyll
df9b9388f04a: Pull complete 
837e9cfc7e43: Pull complete 
c7850f1a8c23: Pull complete 
6ca4c39baa3d: Pull complete 
daa3a8cb79d3: Pull complete 
460c88d0f36d: Pull complete 
Digest: sha256:5776c8eed572003d9ec021767d725b6aa37226bebf4a5219049c063ff8b698ef
Status: Downloaded newer image for jekyll/jekyll:4.2.2
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
Running bundle install in /srv/jekyll... 
jekyll 4.2.2 | Error:  No such file or directory - ruby
/usr/local/lib/ruby/3.1.0/open3.rb:222:in `spawn': No such file or directory - ruby (Errno::ENOENT)
        from /usr/local/lib/ruby/3.1.0/open3.rb:222:in `popen_run'
        from /usr/local/lib/ruby/3.1.0/open3.rb:103:in `popen3'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/utils/exec.rb:17:in `run'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/new.rb:160:in `block in bundle_install'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/new.rb:158:in `chdir'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/new.rb:158:in `bundle_install'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/new.rb:146:in `after_install'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/new.rb:41:in `process'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/new.rb:19:in `block (2 levels) in init_with_program'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from /usr/gem/gems/jekyll-4.2.2/exe/jekyll:15:in `<top (required)>'
        from /usr/gem/bin/jekyll:25:in `load'
        from /usr/gem/bin/jekyll:25:in `<main>'

Trying serve on an existing Jekyll project (cleanly created with jekyll new executed outside of container):

$ docker run --rm -p 4000:4000 -v "$PWD:/srv/jekyll/" jekyll/jekyll:4.2.2 jekyll serve
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
Configuration file: /srv/jekyll/_config.yml
            Source: /srv/jekyll
       Destination: /srv/jekyll/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.468 seconds.
 Auto-regeneration: enabled for '/srv/jekyll'
                    ------------------------------------------------
      Jekyll 4.2.2   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
/usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:179:in `require_relative'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:179:in `setup'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:100:in `process'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `each'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from /usr/gem/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from /usr/gem/gems/jekyll-4.2.2/exe/jekyll:15:in `<top (required)>'
        from /usr/gem/bin/jekyll:25:in `load'
        from /usr/gem/bin/jekyll:25:in `<main>'

Everything works just fine on v4.2.0 (there seems to be no v4.2.1 on Docker Hub):

$ docker run --rm -v "$PWD:/srv/jekyll/" jekyll/jekyll:4.2.0 jekyll new ./
Unable to find image 'jekyll/jekyll:4.2.0' locally
4.2.0: Pulling from jekyll/jekyll
cbdbe7a5bc2a: Pull complete 
aa8ae8202b42: Pull complete 
b21786fe7c0d: Pull complete 
68296e6645b2: Pull complete 
6b1c37303e2d: Pull complete 
d603698ce36b: Pull complete 
Digest: sha256:1ead0631cb82fdbd5950a5eb5b4bfbec5e6e97bb234afc058072e3f32e537751
Status: Downloaded newer image for jekyll/jekyll:4.2.0
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux-musl]
Running bundle install in /srv/jekyll... 
  Bundler: Fetching gem metadata from https://rubygems.org/..........
  Bundler: Resolving dependencies...
  Bundler: Fetching public_suffix 4.0.7
  Bundler: Using bundler 2.2.24
  Bundler: Using colorator 1.1.0
  Bundler: Fetching concurrent-ruby 1.1.10
  Bundler: Using eventmachine 1.2.7
  Bundler: Fetching http_parser.rb 0.8.0
  Bundler: Fetching ffi 1.15.5
  Bundler: Using forwardable-extended 2.6.0
  Bundler: Fetching rb-fsevent 0.11.1
  Bundler: Fetching rexml 3.2.5
  Bundler: Using liquid 4.0.3
  Bundler: Using mercenary 0.4.0
  Bundler: Fetching rouge 3.28.0
  Bundler: Using safe_yaml 1.0.5
  Bundler: Fetching unicode-display_width 1.8.0Bundler::PermissionError: There was an error while trying to write to
  Bundler: `/usr/gem/cache/public_suffix-4.0.7.gem`. It is likely that you need to grant
  Bundler: write permissions for that path.
  Bundler: An error occurred while installing public_suffix (4.0.7), and Bundler cannot
  Bundler: continue.
  Bundler: Make sure that `gem install public_suffix -v '4.0.7' --source
  Bundler: 'https://rubygems.org/'` succeeds before bundling.
  Bundler: 
  Bundler: In Gemfile:
  Bundler: minima was resolved to 2.5.1, which depends on
  Bundler: jekyll-feed was resolved to 0.16.0, which depends on
  Bundler: jekyll was resolved to 4.2.2, which depends on
  Bundler: addressable was resolved to 2.8.0, which depends on
  Bundler: public_suffix

$ docker run --rm -p 4000:4000 -v "$PWD:/srv/jekyll/" jekyll/jekyll:4.2.0 jekyll serve
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux-musl]
Configuration file: /srv/jekyll/_config.yml
            Source: /srv/jekyll
       Destination: /srv/jekyll/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.346 seconds.
 Auto-regeneration: enabled for '/srv/jekyll'
    Server address: http://0.0.0.0:4000/
  Server running... press ctrl-c to stop.

Effectively, the v4.2.2 image is unusable.

@grdryn
Copy link

grdryn commented May 8, 2022

I hit the same problem with the jekyll serve, but I was able to work around it by adding gem "webrick" to my Gemfile.

I see this missing webrick dependency issue is also filed as #335.

@rysiekpl
Copy link
Author

rysiekpl commented Oct 11, 2022 via email

@peterstory
Copy link
Contributor

Hopefully we will see a solution now that Jekyll 4.3.0 has been released:
https://github.com/jekyll/jekyll/releases/tag/v4.3.0

In the Jekyll 4.3.0 release notes:

Add webrick as a dependency

So hopefully a fix is as simple as updating these images to use Jekyll 4.3.0.

@MB175
Copy link

MB175 commented Dec 19, 2022

I hit the same problem with the jekyll serve, but I was able to work around it by adding gem "webrick" to my Gemfile.

I see this missing webrick dependency issue is also filed as #335.

@grdryn Creating a Gemfile results in the container not having access to it, how did u solve that ?

`read': Operation not permitted @ rb_sysopen - /srv/jekyll/Gemfile (Errno::EPERM)

@MB175
Copy link

MB175 commented Dec 19, 2022

gem "webrick"

solved, this one was caused by the docker desktop for Mac mount protection

@lord-executor
Copy link

Looks like I've stumbled into a bit of a ... maintenance issue. The oldest reference to this exact same issue I could find is #335 which is for some reason "locked and limited to collaborators". It's from Apr 12, 2022 and predates this one by a month.

Then there are also

There hasn't been a commit on this project since Apr 20, 2022 and this is really just an issue of a missing Gem, I doubt that this will be fixed any time soon.

Unfortunate, but that is sometimes the reality of open source software. It's free but comes with some caveats.

@bogosj
Copy link

bogosj commented Jan 4, 2024

When I use the image I run it this way:

docker run <options> jekyll/builder:4.2.2 gem install webrick && jekyll serve --watch -P 8080 -p /dev/null

@lord-executor
Copy link

Yes, workarounds for this particular issue are easy. But that doesn't change the fact that they are workarounds and that the project seems to be unmaintained. I'm currently looking into https://github.com/BretFisher/jekyll-serve which works as-is. Or maybe I'll just end up rolling my own Docker image since that is not very difficult and I now had to learn about Jekyll's inner workings anyway :)

@lord-executor
Copy link

And please don't get me wrong here. This is not a "complaint". I know how much time and effort it takes to maintain an open source project. I don't blame anyone for not finding the time to constantly update this and that and dealing with issues and support. It's a lot to ask for free.

@Privat33r-dev
Copy link

@envygeeks it would be amazing if you can find some time to rebuild and post the docker image so everyone can enjoy patched v4. If you want, I can PR a GH action that will autorelease if git tag is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants