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

Error when attempting to serve: bundle exec jekyll s #245

Closed
3 tasks done
mattpopovich opened this issue Jan 11, 2021 · 3 comments
Closed
3 tasks done

Error when attempting to serve: bundle exec jekyll s #245

mattpopovich opened this issue Jan 11, 2021 · 3 comments

Comments

@mattpopovich
Copy link
Contributor

mattpopovich commented Jan 11, 2021

Checklist

  • I have read the tutorials and know the correct effect of the functional design.
  • There are no similar reports on existing issues (including closed ones).
  • I found the bug on the latest code of master branch.

Describe the bug

I'm updating my webpage from ~September 2020 to ~January 2021. I see that the old build and run scripts have been replaced in favor of jekyll s and jekyll b. When I first attempted to run them I got an error:

mattpopovich@Matts-MacBook-Pro-2 ~/Documents/Git/mattpopovich.com-jekyll-theme-chirpy % ruby -v 
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
mattpopovich@Matts-MacBook-Pro-2 ~/Documents/Git/mattpopovich.com-jekyll-theme-chirpy % bundle exec jekyll s
Traceback (most recent call last):
	2: from /usr/bin/bundle:23:in `<main>'
	1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /Users/mattpopovich/Documents/Git/mattpopovich.com-jekyll-theme-chirpy/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`

I then followed the steps on the Jekyll Docs to make sure everything was updated.

Building works without error. The following issue occurs when I attempt to serve:

mattpopovich@Matts-MacBook-Pro-2 ~/Documents/Git/jekyll-theme-chirpy % bundle exec jekyll s
Configuration file: /Users/mattpopovich/Documents/Git/jekyll-theme-chirpy/_config.yml
            Source: /Users/mattpopovich/Documents/Git/jekyll-theme-chirpy
       Destination: /Users/mattpopovich/Documents/Git/jekyll-theme-chirpy/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 1.451 seconds.
 Auto-regeneration: enabled for '/Users/mattpopovich/Documents/Git/jekyll-theme-chirpy'
                    ------------------------------------------------
      Jekyll 4.2.0   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
/Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `require_relative'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `setup'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:100:in `process'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
	from /Users/mattpopovich/.gem/ruby/3.0.0/bin/jekyll:23:in `load'
	from /Users/mattpopovich/.gem/ruby/3.0.0/bin/jekyll:23:in `<top (required)>'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/cli/exec.rb:63:in `load'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/cli/exec.rb:28:in `run'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/cli.rb:494:in `exec'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/cli.rb:30:in `dispatch'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/cli.rb:24:in `start'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/exe/bundle:49:in `block in <top (required)>'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
	from /Users/mattpopovich/.gem/ruby/3.0.0/gems/bundler-2.2.4/exe/bundle:37:in `<top (required)>'
	from /Users/mattpopovich/.gem/ruby/3.0.0/bin/bundle:23:in `load'
	from /Users/mattpopovich/.gem/ruby/3.0.0/bin/bundle:23:in `<main>'

To Reproduce

Steps to reproduce the behavior:
Follow the tutorial on macOS Catalina, install all newest versions of Jekyll, attempt to serve master branch.

Expected behavior

localhost:4000 would show / render the chirpy site

Screenshots

N/A

Software

  • Ruby version: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
  • Gem version: 3.2.3
  • Bundler version: Bundler version 2.2.4
  • Jekyll version: * jekyll (4.2.0)

Desktop

  • macOS 10.15.6

Smartphone

N/A

Additional context

What versions of dependencies are you running? Is it possible that my ruby version is too new? I've listed my installed versions above. Have you tested this with ruby 3.0?

I also attempted to update brew and got this message that I don't ever remember seeing before when updating brew:

mattpopovich@Matts-MacBook-Pro-2 ~/Documents/Git/mattpopovich.com-jekyll-theme-chirpy % brew update 
Error: 
  homebrew-core is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

Which, after fetching, I was able to update brew successfully. Not sure if that would have anything to do with it.

mattpopovich@Matts-MacBook-Pro-2 ~/Documents/Git/mattpopovich.com-jekyll-theme-chirpy % brew -v 
Homebrew 2.7.2
Homebrew/homebrew-core (git revision d05550; last commit 2021-01-11)
Homebrew/homebrew-cask (git revision 67b64; last commit 2021-01-11)

Thanks again for all your work maintaining this repository!

@cotes2020
Copy link
Owner

Hi @mattpopovich,

What versions of dependencies are you running?

All dependencies are listed on Gemfile.lock

Have you tested this with ruby 3.0?

Not yet. My local machine runs on ruby 2.6.3p62 while the CI/CD runs on ruby 2.7

According to the log you provided, I found issue #8523 in the Jekyll repo, and this answer should be useful to you. If not, please inform me.

Thank you for reporting this issue.

@mattpopovich
Copy link
Contributor Author

@cotes2020 speedy and fantastic answer, as always!

For any of those that run into the same issue, I ran bundle add webrick, which resulted in a bundle conflict. I resolved it with bundle update. However, bundle exec jekyll s still failed after that. I then ran bundle add webrick again and after that, bundle exec jekyll s was successful!

@mattpopovich
Copy link
Contributor Author

@cotes2020 added PR #247 that implements this fix.

cotes2020 added a commit that referenced this issue Jun 23, 2021
Since version 3.0, Ruby has no `webrick` that Jekyll (<= 4.2) needs
cotes2020 added a commit that referenced this issue Jun 23, 2021
Since version 3.0, Ruby has no `webrick` that Jekyll (<= 4.2) needs
cotes2020 added a commit that referenced this issue Oct 22, 2021
Since version 3.0, Ruby has no `webrick` that Jekyll (<= 4.2) needs
linkliu pushed a commit to linkliu/game-tech-post-old that referenced this issue Dec 10, 2021
…#344)

Since version 3.0, Ruby has no `webrick` that Jekyll (<= 4.2) needs

(cherry picked from commit 885ed44)
ambersun1234 pushed a commit to ambersun1234/chirpy.ambersun1234.github.io that referenced this issue Feb 10, 2023
…#344)

Since version 3.0, Ruby has no `webrick` that Jekyll (<= 4.2) needs
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

2 participants