Error using Jekyll build and Jekyll serve

I’m just getting started with Jekyll, taking over a website/app deployments from the developers. My colleague actually tried this first, and reported a slightly different issue (https://github.com/jekyll/jekyll/issues/5873#issuecomment-278823777). Essentially the steps I was told to follow were:

  1. Checkout productive branch: git checkout productive
  2. Bring changes from master into productive: git merge --no-ff master
  3. Optimize source code with require: r.js -o ./app/app.build.js (using local installation of r.js)
  4. Copy optimized files from require build folder to application folder:
  5. copy minified main.js: cp …/build/app/main.js ./app/main.js
  6. copy minified main.css: cp …/build/assets/css/main.css ./assets/css/main.css
  7. Build site locally: run jekyll build
  8. Test site locally: run jekyll serve, wait and in your browser go to localhost:4000 or http://127.0.0.1:4000/

I’m running Windows 10, and have Jekyll v 3.6.2 installed.

Steps 1-4 work just fine, however I am encountering errors whenever I run bundle exec jekyll build

Output
Configuration file: c:/Users/cjab/dsm/_config.yml
Source: c:/Users/cjab/dsm
Destination: c:/Users/cjab/dsm/_site
Incremental build: disabled. Enable with --incremental
Generating…
c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/readers/post_reader.rb:39:in block in read_publishable': undefined methodvalid_encoding?’ for nil:NilClass (NoMethodError)
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/readers/post_reader.rb:38:in select' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/readers/post_reader.rb:38:inread_publishable’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/readers/post_reader.rb:27:in read_posts' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/reader.rb:65:inretrieve_posts’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/reader.rb:52:in read_directories' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/reader.rb:18:inread’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/site.rb:165:in read' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/site.rb:71:inprocess’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/command.rb:28:in process_site' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/commands/build.rb:65:inbuild’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/commands/build.rb:36:in process' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/commands/serve.rb:42:inblock (3 levels) in init_with_program’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/commands/serve.rb:42:in each' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/commands/serve.rb:42:inblock (2 levels) in init_with_program’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:ineach’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:ingo’
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program' from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/exe/jekyll:15:in<top (required)>'
from c:/Ruby24-x64/bin/jekyll:23:in load' from c:/Ruby24-x64/bin/jekyll:23:in

Any help with this issue would be much appreciated!

Looks like something’s wrong with your posts…
Please enclose the contents of your terminal output within a pair of backticks, like so:

```
output from terminal
````

What are the contents of your _posts directory? (Providing two or three filenames may be sufficient for now…)