Unable to build Jekyll site locally

I was able to locally build my Jekyll site and then a few months ago, it just wouldn’t build. To my knowledge, nothing changed. I’m finally digging into why it won’t build.

I enter the commands bundle update and bundle exec jekyll serve … and get this error:

Configuration file: C:/[FILEPATH]/doc-standards-processes/_config.yml

Jekyll 4.2.0 Please append --trace to the serve command
for any additional information or backtrace.

Has anyone encountered this before? Any tips?

The default error messaging is minimal.

Please follow the output suggestion and paste here as code. That will tell us why it broke.

bundle exec jekyll serve --trace

Maybe something changed in your Ruby version upgrading or dev tools.

In mac you want to use xcode and on linux install ruby-full with apt to get dev headers.

Here you go! I initially thought this was a Ruby issue, but after a few days with them, I’m told it is not.

$ bundle exec jekyll serve --trace
Configuration file: C:/Users/Elizabeth Warden/Documents/Git/DocProcess/doc-standards-processes/_config.yml
Source: C:/Users/Elizabeth Warden/Documents/Git/DocProcess/doc-standards-processes
Destination: C:/Users/Elizabeth Warden/Documents/Git/DocProcess/doc-standards-processes/_site
Incremental build: disabled. Enable with --incremental
Generating…
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/utils.rb:141:in initialize': Invalid argument @ rb_sysopen - C:/Users/Elizabeth Warden/Documents/Git/DocProcess/doc-standards-processes/Gem.win_platform? (Errno::EINVAL) from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/utils.rb:141:in open’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/utils.rb:141:in has_yaml_header?' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/reader.rb:52:in block in read_directories’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/reader.rb:48:in each' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/reader.rb:48:in read_directories’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/reader.rb:16:in read' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:181:in read’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:78:in process' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:28:in process_site’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:65:in build' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:36:in process’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in block in process_with_graceful_fail' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in each’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in process_with_graceful_fail' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in block (2 levels) in init_with_program’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in block in execute' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in each’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in execute' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in go’
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in program' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/exe/jekyll:15:in <top (required)>’
from C:/Ruby27-x64/bin/jekyll:23:in load' from C:/Ruby27-x64/bin/jekyll:23:in

Can you edit and put that in code fences so it is monospaced?

```
Paste here as code 
or output
```

Result:

Paste here as code
or output 

Sorry I don’t know what’s up with that invalid argument.

Downgrade to Jekyll 4.1

Delete your lock file.

Delete your vendor folder.

Run bundle install for a clean install.

Then Jekyll serve.

Maybe it is something specific in your plugins or config. See if you can make a new simple project and run that.

Create a new directory outside the repo.

Add jekyll 4.1 to the Gemfile.

Run your steps to configure bundle and install gems to vendor directory.

If you get Jekyll installed there, you can do bundle exec jekyll new .

And then bundle exec jekyll serve

Or within your current project, you can try make a new bootstrapped project in a subdirectory. With it’s own gems and project files.

bundle exec jekyll new test-app
cd test-app
bundle exec jekyll serve

Hello @ElizabethWarden
The error can be summarized as being unable to open the following path:

C:/Users/Elizabeth Warden/Documents/Git/DocProcess/doc-standards-processes/Gem.win_platform?

Do you have such a directory in your Jekyll workspace?
Lastly, is it possible by any chance that your site’s source files be publicly accessible?

1 Like

Hi @ashmaroli - Yes, I do have that Gem.win_platform file in the directory you indicated.

I do not believe that our site’s source files are publicly accessible

Okay. Please delete that folder or file if it doesn’t contain anything important.
From Jekyll’s point of view, it is not an important folder or file.

1 Like

@ashmaroli That worked!!! I deleted the Gem.win_platform file and my site built locally! Thank you so much. I can’t believe it was such a simple solution.

1 Like

Hi ashmaroli,
I’m encountering exactly the same issue as Elizabeth. But apparently, the solution is not applicable to me, as I don’t see Gem.wi_platform file. Most likely because I’m on Mac.

Here’s the error details after running " bundler exec jekyll serve --trace".

I spent few hours on the internet but didn’t find any solution. Your inputs will be really appreciated here. Thanks in advance!

bundler: failed to load command: jekyll (/Users/GM4EVR/gems/bin/jekyll)
/Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in require': cannot load such file -- webrick (LoadError ) from /Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in <top (required)>’
from /Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in require_relative' from /Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in setup’
from /Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:100:in process' from /Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in block in process_with_graceful_fail’
from /Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in each' from /Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in process_with_graceful_fail’
from /Users/GM4EVR/gems/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program’

    from /Users/GM4EVR/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
    from /Users/GM4EVR/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
    from /Users/GM4EVR/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
    from /Users/GM4EVR/gems/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
    from /Users/GM4EVR/gems/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
    from /Users/GM4EVR/gems/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
    from /Users/GM4EVR/gems/bin/jekyll:23:in `load'
    from /Users/GM4EVR/gems/bin/jekyll:23:in `<top (required)>'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/cli/exec.rb:63:in `load'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/cli/exec.rb:63:in `kernel_load'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/cli/exec.rb:28:in `run'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/cli.rb:494:in `exec'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/cli.rb:30:in `dispatch'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/cli.rb:24:in `start'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/exe/bundle:49:in `block in <top (required)>'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/exe/bundle:37:in `<top (required)>'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/exe/bundler:4:in `load'
    from /Users/GM4EVR/gems/gems/bundler-2.2.8/exe/bundler:4:in `<top (required)>'
    from /Users/GM4EVR/gems/bin/bundler:23:in `load'
    from /Users/GM4EVR/gems/bin/bundler:23:in `<main>'

hello! i have the same problem too. How you can fix this problem? thank you

you should create a new post and give your details there, especially the output from the terminal as well as a link to the repo if you can.

1 Like