# Jekyll build fails - \`sort\_docs!': no implicit conversion of String into Integer

**URL:** <https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678>\
**Category:** Help\
**Created:** [December 5, 2019, 11:43pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678 "2019-12-05T23:43:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ash](https://talk.jekyllrb.com/u/ash)\
**Post date:** [December 5, 2019, 11:43pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/1 "2019-12-05T23:43:50Z")

</div>

Hi everyone,

I installed Jekyll 4.0 using the Windows install instructions [here](https://jekyllrb.com/docs/installation/windows/), and it looked like everything went well, but when I run `jekyll build --trace`, I get:

```
    Traceback (most recent call last):
            22: from C:/Ruby26-x64/bin/jekyll:23:in `<main>'
            21: from C:/Ruby26-x64/bin/jekyll:23:in `load'
            20: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
            19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
            18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
            17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
            16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
            15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
            14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
            13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
            12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
            11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
            10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:36:in `process'
             9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:65:in `build'
             8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:28:in `process_site'
             7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/site.rb:74:in `process'
             6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/site.rb:174:in `read'
             5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/reader.rb:20:in `read'
             4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/readers/collection_reader.rb:17:in `read'
             3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/readers/collection_reader.rb:17:in `each_value'
             2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/readers/collection_reader.rb:18:in `block in read'
             1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/collection.rb:68:in `read'
    C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/collection.rb:223:in `sort_docs!': no implicit conversion of String into Integer (TypeError)

```

`jekyll serve --trace` shows the same. Obviously there’s an issue with `'sort_docs!`, but I don’t know how to fix it. Any ideas?

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 6, 2019, 3:42am UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/2 "2019-12-06T03:42:49Z")

</div>

Hi… Did you fork and clone an existing repository or just customized the boilerplate from  
`jekyll new`…? If it was the former case, I’d like to know the repo’s location. Otherwise, I’d like to see the contents of your config file.

---

<div class="post-metadata">

**Author:** ![ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ash](https://talk.jekyllrb.com/u/ash)\
**Post date:** [December 6, 2019, 7:33pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/3 "2019-12-06T19:33:24Z")

</div>

Hi - thanks very much for your response!

So…I’m gonna level with you. I’m not a developer, nor am I very tech savvy, plus my purpose for using Jekyll is likely a bit unconventional, so while I absolutely welcome any advice you might have, you should know that I might need quite a bit of hand-holding through this.

With that warning out of the way, here are the contents of the \_config.yml file:

```
collections:

  apis:
    output: true

  defaults:
    - scope:
        path: ""
        type: "apis"
      values:
        layout: "api"
    - scope:
        path: ""
      values:
        layout: "default"

```

Any ideas? I really appreciate any help you could provide.

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 6, 2019, 9:05pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/4 "2019-12-06T21:05:56Z")

</div>

The configuration looks sane and benign. So perhaps there’s an offending filename…  
Please post the _complete output_ from running the following:

```auto
bundle exec jekyll build --verbose --trace

```

or if there is no Gemfile in your project directory, then

```auto
jekyll build --verbose --trace

```

---

<div class="post-metadata">

**Author:** ![ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ash](https://talk.jekyllrb.com/u/ash)\
**Post date:** [December 6, 2019, 10:50pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/5 "2019-12-06T22:50:55Z")

</div>

No gemfile in the directory. Here’s the output:

```
  Logging at level: debug
    Jekyll Version: 4.0.0
Configuration file: C:/Users/ash/Documents/JekyllRoot/_config.yml
            Source: C:/Users/ash/Documents/JekyllRoot
       Destination: C:/Users/ash/Documents/JekyllRoot/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       EntryFilter: excluded /Gemfile.txt
Traceback (most recent call last):
        22: from C:/Ruby26-x64/bin/jekyll:23:in `<main>'
        21: from C:/Ruby26-x64/bin/jekyll:23:in `load'
        20: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
        19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
        17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
        16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
        15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
        14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
        13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
        12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
        11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
        10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:36:in `process'
         9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:65:in `build'
         8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:28:in `process_site'
         7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/site.rb:74:in `process'
         6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/site.rb:174:in `read'
         5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/reader.rb:20:in `read'
         4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/readers/collection_reader.rb:17:in `read'
         3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/readers/collection_reader.rb:17:in `each_value'
         2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/readers/collection_reader.rb:18:in `block in read'
         1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/collection.rb:68:in `read'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/collection.rb:223:in `sort_docs!': no implicit conversion of String into Integer (TypeError)
```

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 7, 2019, 4:13am UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/6 "2019-12-07T04:13:00Z")

</div>

I see a line saying `excluded /Gemfile.txt` in the output.  
Having a file named `Gemfile.txt` is not an ordinary sight. I’m now curious to see the actual contents of your source directory.

Will you be able to upload the source directory as is to the internet and let me have a look at it…?

---

<div class="post-metadata">

**Author:** ![ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ash](https://talk.jekyllrb.com/u/ash)\
**Post date:** [December 9, 2019, 11:11pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/7 "2019-12-09T23:11:52Z")

</div>

Will this work?

[https://drive.google.com/open?id=1UTfKZMND7dR9\_mIhNagEDeAgDGL0Hg6-](https://drive.google.com/open?id=1UTfKZMND7dR9_mIhNagEDeAgDGL0Hg6-)

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 10, 2019, 2:29am UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/8 "2019-12-10T02:29:09Z")

</div>

What you uploaded is your Ruby installation files.  
I was instead referring to the contents of your Jekyll site’s _source_ directory…  
_i.e., the contents of `C:/Users/ash/Documents/JekyllRoot`_

---

<div class="post-metadata">

**Author:** ![ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ash](https://talk.jekyllrb.com/u/ash)\
**Post date:** [December 10, 2019, 5:31pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/9 "2019-12-10T17:31:50Z")

</div>

Sorry about that…here you go.

[https://drive.google.com/open?id=1IqeZuhSgM\_mrcHvl9dMl0sqzskBk7Hsn](https://drive.google.com/open?id=1IqeZuhSgM_mrcHvl9dMl0sqzskBk7Hsn)

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 10, 2019, 9:00pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/10 "2019-12-10T21:00:11Z")

</div>

The error is in your config file.  
YAML is indentation-sensitive. The entire `defaults` block is indented 2 spaces more than key `collection`. Therefore, it gets interpreted as a separate collection.

### Wrong

```auto
collections:
  apis:
    output: true

  defaults:
    - scope:
        path: ""
        type: "apis"
      values:
        layout: "api"

```

### Right

```auto
collections:
  apis:
    output: true

defaults:
  - scope:
      path: ""
      type: "apis"
    values:
      layout: "api"

```

---

<div class="post-metadata">

**Author:** ![ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ash](https://talk.jekyllrb.com/u/ash)\
**Post date:** [December 10, 2019, 11:13pm UTC](https://talk.jekyllrb.com/t/jekyll-build-fails-sort-docs-no-implicit-conversion-of-string-into-integer/3678/11 "2019-12-10T23:13:45Z")

</div>

You’re right, that fixed it. Thank you, thank you, thank you very much for all your help with this!
