OBOFoundry / OBOFoundry.github.io

Metadata and website for the Open Bio Ontologies Foundry Ontology Registry
http://obofoundry.org
Other
166 stars 204 forks source link

Some challenges getting the site running on Docker #2212

Closed nlharris closed 2 years ago

nlharris commented 2 years ago

Discussed in https://github.com/OBOFoundry/OBOFoundry.github.io/discussions/2154

Originally posted by **erik-whiting** October 10, 2022 Hey I know it's probably better to dev and test the site in a Docker container but I have never been able to get the container to work. If it matters, I'm on Windows but the errors I'm getting don't seem specific to my OS. When I run: ```powershell $> docker run --rm --volume="$(pwd):/srv/jekyll" -p 4000:4000 -it jekyll/jekyll:latest jekyll serve ``` I get this error: ``` 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... done in 10.661 seconds. Auto-regeneration may not work on some Windows versions. Please see: https://github.com/Microsoft/BashOnWindows/issues/216 If it does not work, please upgrade Bash on Windows or run Jekyll with --no-watch. Auto-regeneration: enabled for '/srv/jekyll' :85:in `require': cannot load such file -- webrick (LoadError) from :85:in `require' from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `' 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 `' from /usr/gem/bin/jekyll:25:in `load' from /usr/gem/bin/jekyll:25:in `
' ``` If I run it with the `--no-watch` flag as suggested, it still fails but with a different error. Has anyone run across this error and know what to do? I am usually ok just running `jekyll serve -p 4000:4000` from my command line but if everyone is developing and testing against Docker, I should too.
nlharris commented 2 years ago

@erik-whiting Nico had similar issues, maybe you can try pinning to jekyll 3.5 with

docker run --rm --volume="$(pwd):/srv/jekyll" -p 4000:4000 -it jekyll/jekyll:3.5 jekyll serve
nlharris commented 2 years ago

(erik said that worked)

(and now you see why I hate Discussions! There is no way to "close" a Discussion, only delete. I had to hand-copy that response to an issue so it wouldn't be lost forever when I delete the Discussion. Or I could leave the Discussion hanging around forever, even though the question has been answered.)