`bundle exec jekyll serve` stuck after detecting config file on Windows 10

Whenever I do bundle exec jekyll serve in the command line, it gets stuck at this line

Configuration file: C:/Users/User/blog_dir/_config.yml

and the terminal just hangs at this command, nothing happens even after 1 hour.

I have tried doing bundle add webrick, adding gem "webrick" to my Gemfile, and bundle install, etc, but all of these solutions do not work and the command still just gets stuck after detecting the config file, even after adding webrick.

Current versions of stuff being used
Ruby: 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
Bundler: 2.2.30
Windows 10 Home: 10.0.19043 Build 19043

I have tried on different OSes and machines, literally this problem only happens on windows. Does anyone know how to solve this?

maybe there is some sort of illegal character in the config file? is this from a new jekyll site or did you copy from somewhere?

what is in the config file? link to repo?

I cannot give the link to the repo because the repo is private, and no there are no illegal characters in the config file. Everything runs fine when I run the command on linux, so I don’t think that should be the issue… :frowning:

The config file is based off a theme that I was using, but has been edited since. The theme is here Jekyll Atlantic Theme - Zerostatic

The blog is not new, I have been working on it on some time, but I am limited to working on the site on linux because I cannot get bundle exec jekyll serve to run on Windows…

@raniceyue I suggest trying a build using Ruby 2.7 on Windows.
(Ensure 2.7 by running ridk use ... before invoking Jekyll).

If it still hangs, try again by appending --verbose to the invocation.
If it doesn’t hang on Ruby 2.7 and you would really like to use Ruby 3 on Windows, try installing the very recent Ruby 3.0.3.

Thank you so much for the suggestion.

I have downloaded and installed ruby 2.7 + the devkit, ran ridk use 2.7 and ran bundle exec jekyll serve --verbose, however the problem still persists and the command still gets stuck

Here is the output, and it literally just stops here

C:\Users\ranny\Github\cafe-exploitation>bundle exec jekyll serve --verbose
  Logging at level: debug
    Jekyll Version: 4.2.1
Configuration file: C:/Users/ranny/Github/cafe-exploitation/_config.yml
  Logging at level: debug
    Jekyll Version: 4.2.1
         Requiring: jekyll-environment-variables
         Requiring: jekyll-postcss
         Requiring: jekyll-paginate

Does it have something to do with the version of Jekyll that I’m using??? I am pretty 100% sure I am using ruby 2.7 here…

I am unable to install the most latest version of ruby as it is not available via the ruby installer for windows yet. I guess if I really can’t work this out I’ll just stick to using Jekyll on Linux…

did you uninstall the other ruby just to be sure? which ruby should tell you which ruby is currently setup.

I use win 10 and have never had a problem.

What happens if you create a new jekyll site and run that? does that work?

Hello, I have just tried creating a new blog with jekyll new and WOW the new blog actually works with no issues… That means it must be a problem with my gemfile or one of the plugins that I’m using?

Here is my gemfile

source "https://rubygems.org"

gem "jekyll", "~> 4.1"
gem "jekyll-environment-variables"
gem "jekyll-postcss"
gem "jekyll-paginate"
gem "webrick"

Does anyone have any ideas?

1 Like

Well your log message stopped at paginate step so I guess that could be it. Disable that plugin and see if it helps.

Otherwise disable plugins one by one. By one of them has poor Windows support.

You can also use the Jekyll new Gemfile. Note with this one it includes gems specific to improve or fix Windows behavior so I’d say try that

did you install postcss? jekyll-postcss says you must install it as well as putting it in your gemfile. Not sure what that means, I assume it is an npm module but not positive.

Hey everyone!

Found this post and I must say I encounter the exact same issue.

Running bundle exec jekyll serve --verbose gives me this output:

$ bundle exec jekyll serve --verbose
  Logging at level: debug
    Jekyll Version: 4.3.2
Configuration file: D:/GitHub/fedi-foundation/_config.yml
  Logging at level: debug
    Jekyll Version: 4.3.2
         Requiring: jekyll-feed
         Requiring: jekyll-sitemap
         Requiring: jekyll-paginate
         Requiring: jemoji

My current guess is, that jekyll-postcss is the issue here.
You may be confused, but there are reasons for why I assume this.

First of all, the Gem file and _config.yml did have jekyll-postcss set as a jekyll plugin before I removed it for assuming it was the issue (Guess it wasn’t fixed by just removing it).
Secondly, cacnelling the executing gives me a stacktrace that mentions Jekyll-postcss:

D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-postcss-0.5.0/lib/jekyll-postcss/socket.rb:62:in `initialize': Interrupt
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-postcss-0.5.0/lib/jekyll-postcss/socket.rb:62:in `open'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-postcss-0.5.0/lib/jekyll-postcss/socket.rb:62:in `start_dev_server'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-postcss-0.5.0/lib/jekyll-postcss/socket.rb:13:in `initialize'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-postcss-0.5.0/lib/jekyll/converters/postcss.rb:16:in `new'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-postcss-0.5.0/lib/jekyll/converters/postcss.rb:16:in `block in initialize'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-postcss-0.5.0/lib/jekyll/converters/postcss.rb:16:in `fetch'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-postcss-0.5.0/lib/jekyll/converters/postcss.rb:16:in `initialize'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:321:in `new'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:321:in `block (2 levels) in instantiate_subclasses'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:321:in `map!'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:321:in `block in instantiate_subclasses'
        from <internal:kernel>:90:in `tap'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:319:in `instantiate_subclasses'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:133:in `setup'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:36:in `initialize'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:30:in `new'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:30:in `process'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in `each'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from D:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/exe/jekyll:15:in `<top (required)>'
        from D:/Ruby31-x64/bin/jekyll:25:in `load'
        from D:/Ruby31-x64/bin/jekyll:25:in `<main>'

The current gem file seems to be fine?

source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#

# If you have any plugins, put them here!
gem 'wdm', '>= 0.1.0', :install_if => Gem.win_platform?
group :jekyll_plugins do
    gem 'jekyll-feed'
    gem 'jekyll-sitemap'
    gem 'jekyll-paginate'
end
gem "webrick", "~> 1.7"
gem 'jemoji'

My PC also runs Windows 10.

Any ideas?

Small update: I overlooked the gem file and I didn’t remove postcss there… Removing it made Jekyll work fine again.

I also found a solution which is to use jekyll-postcss-v2 instead.