Livereload falling in windows 10

Hi there! I’m new in jekyll, and quite new in web development as well.
I’m trying to learn jekyll, by coding a personal portfolio with it, and host it in github pages.
I red all the documentation in https://jekyllrb.com/docs/, so I’m aware that jekyll is not officialy supported in w10, but I have no mac around so… I’ll give it a try.

The software versions I use:

  • Windows 10 pro v21H1
  • VSCode 1.60.2
  • ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x64-mingw32]
  • jekyll 4.2.0

I followed the step by step guide, and have my test project running.

The current behavior:

  • jekyll serve runs just fine
  • jekyll serve --livereload runs ok for may be a minute, but after a few edits in html or css files, it crashes
  • jekyll serve (but editing the config.yml so livereload: true) gives same result as above.

The error:

Regenerating: 1 file(s) changed at 2021-09-22 16:48:46
                    index.html
       Jekyll Feed: Generating feed for posts
          Conflict: The following destination is shared by multiple files.
                    The written file may end up with unexpected contents.
                    C:/Users/marti/Desktop/portfolio/_site/assets/main.css
                     - assets/main.scss
                     - C:/Users/marti/Desktop/portfolio/assets/main.css

                    ...done in 0.0334317 seconds.

      Regenerating: 1 file(s) changed at 2021-09-22 16:48:57
                    index.html
       Jekyll Feed: Generating feed for posts
#<Thread:0x0000017a8c646308 C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:41 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:44:in `block in start'
        6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/eventmachine.rb:197:in `run'
        5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:144:in `run_machine'
        4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:547:in `run'
        3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:547:in `loop'
        2: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:553:in `block in run'
        1: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:595:in `crank_selectables'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:595:in `select': Se intent¾ realizar una operaci¾n en un elemento que no es un socket. (Errno::ENOTSOCK)
        7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:44:in `block in start'
        6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/eventmachine.rb:197:in `run'
        5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:144:in `run_machine'
        4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:562:in `run'
        3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:559:in `ensure in run'
        2: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:559:in `each'
        1: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:559:in `block in run'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:559:in `close': Bad file descriptor (Errno::EBADF)
                    ------------------------------------------------
      Jekyll 4.2.0   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
Traceback (most recent call last):
        7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:44:in `block in start'
        6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/eventmachine.rb:197:in `run'
        5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:144:in `run_machine'
        4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:547:in `run'
        3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:547:in `loop'
        2: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:553:in `block in run'
        1: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:595:in `crank_selectables'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:595:in `select': Se intent¾ realizar una operaci¾n en un elemento que no es un socket. (Errno::ENOTSOCK)
        7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:44:in `block in start'
        6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/eventmachine.rb:197:in `run'
        5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:144:in `run_machine'
        4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:562:in `run'
        3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:559:in `ensure in run'
        2: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:559:in `each'
        1: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:559:in `block in run'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/em/pure_ruby.rb:559:in `close': Bad file descriptor (Errno::EBADF)
#<Thread:0x0000017a8dfa5218 C:/Ruby27-x64/lib/ruby/2.7.0/webrick/server.rb:286 aborting> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        2: from C:/Ruby27-x64/lib/ruby/2.7.0/webrick/server.rb:323:in `block in start_thread'   
        1: from C:/Ruby27-x64/lib/ruby/2.7.0/webrick/server.rb:323:in `ensure in block in start_thread'
C:/Ruby27-x64/lib/ruby/2.7.0/webrick/server.rb:323:in `close': Bad file descriptor (Errno::EBADF)

Already tried to:

  • Adding require 'em/pure_ruby' to
    C:\Ruby24-x64\lib\ruby\gems\2.4.0\gems\eventmachine-1.2.5-x64-mingw32\lib directiry.

  • Re installing event machine with
    gem uninstall eventmachine (select all versions if prompted)
    gem install eventmachine --platform ruby

  • Added this lines to the gemfile:

# Performance-booster for watching directories on Windows
gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?
  • runing the jekyll serve command from vscode terminal, comand pompt and power sell from windows.

but it still behaves the same.

Does anyone has any clue on this one?
Thanks in advance!

1 Like

is that something you would have typed? I’m guessing not but it seems weird. If you search for that in VS Code where is it? in the eventmachine node modules?

I’d also do like it says and append --trace to the serve command and see if it tells you anything.

I use jekyll on windows with no issues.

Is the source code for the repo from an existing site or did you start from the jekyll new command?

Thanks for your reply.

Se intent¾ realizar una ope

That quote is not something that I wrote. It’s an error message in Spanish (the language of my pc), it translate to “An operation was attempted on an item that is not a socket”.
Both errors link to pure_ruby.rb, to the middle of a function that I don’t know what it does.

This is the error message that comes out with --trace

PS C:\Users\marti\Desktop\portfolio> jekyll serve --trace
Configuration file: C:/Users/marti/Desktop/portfolio/_config.yml
            Source: C:/Users/marti/Desktop/portfolio      
       Destination: C:/Users/marti/Desktop/portfolio/_site
 Incremental build: disabled. Enable with --incremental   
      Generating...
       Jekyll Feed: Generating feed for posts
          Conflict: The following destination is shared by multiple files.
                    The written file may end up with unexpected contents.
                    C:/Users/marti/Desktop/portfolio/_site/assets/main.css
                     - assets/main.scss
                     - C:/Users/marti/Desktop/portfolio/assets/main.css
                    done in 0.435 seconds.
 Auto-regeneration: enabled for 'C:/Users/marti/Desktop/portfolio'
LiveReload address: http://127.0.0.1:35729
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
        LiveReload: Browser connected
      Regenerating: 1 file(s) changed at 2021-09-23 00:50:55
                    assets/main.css
       Jekyll Feed: Generating feed for posts
          Conflict: The following destination is shared by multiple files.
                    The written file may end up with unexpected contents.
                    C:/Users/marti/Desktop/portfolio/_site/assets/main.css
                     - assets/main.scss
                     - C:/Users/marti/Desktop/portfolio/assets/main.css
                    ...done in 0.0590326 seconds.

      Regenerating: 1 file(s) changed at 2021-09-23 00:51:06
                    assets/main.css
       Jekyll Feed: Generating feed for posts
          Conflict: The following destination is shared by multiple files.
                    The written file may end up with unexpected contents.
                    C:/Users/marti/Desktop/portfolio/_site/assets/main.css
                     - assets/main.scss
                     - C:/Users/marti/Desktop/portfolio/assets/main.css
                    ...done in 0.0435103 seconds.

#<Thread:0x07924950 C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:41 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        7: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:44:in `block in start'       
        6: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/eventmachine.rb:197:in `run'
        5: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:144:in `run_machine'
        4: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:547:in `run'
        3: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:547:in `loop'
        2: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:553:in `block in run'
        1: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:595:in `crank_selectables'
C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:595:in `select': Se intent¾ realizar una operaci¾n en un elemento que no es un socket. (Errno::ENOTSOCK)
        7: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:44:in `block in start'       
        6: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/eventmachine.rb:197:in `run'
        5: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:144:in `run_machine'
        4: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:562:in `run'
        3: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:559:in `ensure in run'
        2: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:559:in `each'
        1: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:559:in `block in run'
C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:559:in `close': Bad file descriptor (Errno::EBADF)      
Traceback (most recent call last):
        7: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:44:in `block in start'       
        6: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/eventmachine.rb:197:in `run'
        5: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:144:in `run_machine'
        4: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:547:in `run'
        3: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:547:in `loop'
        2: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:553:in `block in run'
        1: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:595:in `crank_selectables'
C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:595:in `select': Se intent¾ realizar una operaci¾n en un elemento que no es un socket. (Errno::ENOTSOCK)
        7: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:44:in `block in start'       
        6: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/eventmachine.rb:197:in `run'
        5: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:144:in `run_machine'
        4: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:562:in `run'
        3: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:559:in `ensure in run'
        2: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:559:in `each'
        1: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:559:in `block in run'
C:/Ruby27/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x86-mingw32/lib/em/pure_ruby.rb:559:in `close': Bad file descriptor (Errno::EBADF)      
PS C:\Users\marti\Desktop\portfolio> 

Also tried uninstalling ruby outright and reinstalling the x86 version of it, same version number, as I saw in some posit in Stack Overflow, but the behavior is the same.

You said that you use jekyll over windows, did you install it from ruby installer, or have you used the linux subsystem for windows?

The source code is a local folder at my desktop. Tried both the jekyll new command, aswell as manually adding files to a folder, as this guide sugest, : https://jekyllrb.com/docs/step-by-step/01-setup/
with no difference.

I’m not using WSL, usually poweshell via the console in VS Code.

I install ruby with the devkit via the ruby installer. Currently ruby 2.6.6. If you don’t have the devkit lots of things won’t work but you get an error about not being able to build native extensions or something. Could be worth trying 2.6.6 though.

if you google pure_ruby.rb:559:in close’: Bad file descriptor (Errno::EBADF)` you’ll find some posts that match your issue, they didn’t seem to have a solution.

1 Like

Hi. This looks like a past forum topic

I searched WSL and this was the first result I got. My answer to a question saying to force polling as solution

I’ve devkit indeed.
Will try 2.6.6 and let you know.

I also tryied --force-polling with no changes.