# Updating to ruby 3: "Error: could not read file" "wrong number of arguments (given 1, expected 0)"

**URL:** <https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619>\
**Category:** Help\
**Created:** [October 17, 2023, 11:14am UTC](https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619 "2023-10-17T11:14:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mouseb](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@mouseb](https://talk.jekyllrb.com/u/mouseb)\
**Post date:** [October 17, 2023, 11:14am UTC](https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619/1 "2023-10-17T11:14:56Z")

</div>

after updating debian to current stable, and so upgrading ruby to 3.1 (from 2.7), i receive the error in the title for all .md and all .org files in my site:

```auto
Error: could not read file /path/to/site/markdown-file.md: wrong number of arguments (given 1, expected 0)

```

i followed the instructions at:

> [@Upgrade to Ruby 3 - tutorial](https://talk.jekyllrb.com/t/upgrade-to-ruby-3-tutorial/6113/6):
>
> Hello slight_smile I am new to learning Jekyll and only just installed Jekyll and Ruby and therefor have the latest versions installed. I also get the webrick issue and can fix it by adding the “bundle add webrick” command to every project. But I’m not sure how to fix this so I don’t have to manually add the bundle everytime after running “jekyll new \*\*\*\*”. What’s the best way to fix this if you’re not upgrading? thank you

(that is, after upgrading broke, i removed all local+system gems, removed all system ruby, and tried to start over, then followed the reinstall instructions for jekyll.)

i only have a system ruby install, and a local bundler/jeykll/deps install.

earlier, i also tried to force the install of all the old versions of my gems, to see if my site was somehow hitched to them, to no avail.

i have searched for this error and not found anything.

ruby version:

```auto
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]

```

jekyll won’t tell me its version, but i have the latest gems for it and deps.

`bundle info jekyll` returns: `jekyll (4.3.2)`

my site runs minimal mistakes, and i have `minimal-mistakes-jekyll (4.24.0)`. (when i run `bundle exec jekyll serve` i now also receive a number of deprecation warnins about its calling of sass functions (subtraction and so on) but i don’t understand if/how that could cause the issue above?)

has anyone seen this error or might have any tips on how to unbreak my site?

---

<div class="post-metadata">

**Author:** ![mouseb](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@mouseb](https://talk.jekyllrb.com/u/mouseb)\
**Post date:** [October 25, 2023, 10:20am UTC](https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619/2 "2023-10-25T10:20:14Z")

</div>

i fixed the deprecation warnings using a fix from the minimal-mistakes repo, downgrading a sass library.

but my site is still broken with the errors regarding all my posts’ .md files.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [October 25, 2023, 3:31pm UTC](https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619/3 "2023-10-25T15:31:49Z")

</div>

can you paste the entire output from the console when you run jekyll?

if it literally can’t read a file that is there maybe it is a security issue and something doesn’t have the proper rights?

---

<div class="post-metadata">

**Author:** ![mouseb](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@mouseb](https://talk.jekyllrb.com/u/mouseb)\
**Post date:** [October 26, 2023, 11:13am UTC](https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619/4 "2023-10-26T11:13:09Z")

</div>

sure, it looks like so:

```auto
Configuration file: /path/to/site/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /path/to/site
       Destination: /path/to/site/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 

 Error: could not read file /path/to/md-files/md-file.md: wrong number of arguments (given 1, expected 0)
[once for every md/org file on my site, in red]

Jekyll Feed: Generating feed for posts
         AutoPages: Disabled/Not configured in site.config.
        Pagination: Complete, processed 1 pagination page(s)
                    done in 1.381 seconds.
 Auto-regeneration: enabled for '/path/to/my/site'
  JekyllAdmin mode: production
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.

```

i had installed my minimal-mistakes theme as a gem, but then later modified it, meaning i copied some of its site/layout files over directly into my site and edited a few layout files. but i’m not sure that could lead to this issue (due to updates conflicts maybe?). to try to get around that, i removed the modified directories, but then it just complained they weren’t there, rather than picking them up from the gem. (i’m unsure if that’s something related or not.)

---

<div class="post-metadata">

**Author:** ![mouseb](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@mouseb](https://talk.jekyllrb.com/u/mouseb)\
**Post date:** [October 26, 2023, 11:30am UTC](https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619/5 "2023-10-26T11:30:23Z")

</div>

but also, the error isn’t that it can’t find the file, but that the signature of the function being called has changed: it received 1 arg, expected 0 args.

it’s a pretty unhelpful error that gives a signature error without mentioning the function called.

if i serve with `-V` enabled, i receive errors like so (1 for each file):

```auto
Skipping: Content in _posts/my-post.md is nil

```

but i’ve checked, and the files are there, and not empty.

would it be plausible to create a new jekyll site, with the same, theme, apply my modifications, and manually copy over my text files?

---

<div class="post-metadata">

**Author:** ![mouseb](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@mouseb](https://talk.jekyllrb.com/u/mouseb)\
**Post date:** [October 26, 2023, 11:34am UTC](https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619/6 "2023-10-26T11:34:55Z")

</div>

i’ve just noticed the “about” md page is picked up. it’s in `_pages`, while things in `_posts` and other similar custom directories are ignored.

---

<div class="post-metadata">

**Author:** ![mouseb](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@mouseb](https://talk.jekyllrb.com/u/mouseb)\
**Post date:** [October 26, 2023, 1:54pm UTC](https://talk.jekyllrb.com/t/updating-to-ruby-3-error-could-not-read-file-wrong-number-of-arguments-given-1-expected-0/8619/7 "2023-10-26T13:54:31Z")

</div>

_sigh_, i fixed it.

it was an old/broken/unmaintained plugin, jekyll-org. one would hope such a plugin wouldn’t also break .md files, but alas thats not how it works, or rather thats not how it breaks.
