# Error: no implicit conversion of Hash into Integer

**URL:** <https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890>\
**Category:** Uncategorized\
**Created:** [April 15, 2021, 7:46pm UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890 "2021-04-15T19:46:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![zuntik](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/zuntik/32/3436_2.png) [@zuntik](https://talk.jekyllrb.com/u/zuntik)\
**Post date:** [April 15, 2021, 7:46pm UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/1 "2021-04-15T19:46:34Z")

</div>

Hi. I’m trying to follow the [github-pages](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll) guide for jekyll. I’m not having much luck. because it keeps crashing when I run:

```nohighlight
$ bundle exec jekyll serve     
Configuration file: /home/user/Documents/blog/docs/_config.yml
            Source: /home/user/Documents/blog/docs
       Destination: /home/user/Documents/blog/docs/_site
Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 0.223 seconds.
jekyll 3.9.0 | Error: no implicit conversion of Hash into Integer
/home/user/.local/share/gem/ruby/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read': no implicit conversion of Hash into Integer (TypeError)
        from /home/user/.local/share/gem/ruby/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/utils/platforms.rb:75:in `proc_version'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/utils/platforms.rb:40:in `bash_on_windows?'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:77:in `watch'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:43:in `process'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `block in start'

```

I installed bundle and jekyll the [reccomended way](https://wiki.archlinux.org/index.php/Ruby#RubyGems)

The version of jekyll available in my path is 4.2.0. I discovered this by running `jekyll -v`. But I had to run this outside of the project directory. if I run `jekyll -v`in the poject directory it gives the following output

```nohighlight
$ jekyll -v
/home/user/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/runtime.rb:302:in `check_for_activated_spec!': You have already activated i18n 1.8.10, but your Gemfile requires i18n 0.9.5. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
        from /home/user/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/runtime.rb:31:in `block in setup'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/spec_set.rb:152:in `each'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/spec_set.rb:152:in `each'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/runtime.rb:26:in `map'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/runtime.rb:26:in `setup'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler.rb:148:in `setup'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
        from /home/user/.local/share/gem/ruby/3.0.0/gems/jekyll-4.2.0/exe/jekyll:11:in `<top (required)>'
        from /home/user/.local/share/gem/ruby/3.0.0/bin/jekyll:23:in `load'
        from /home/user/.local/share/gem/ruby/3.0.0/bin/jekyll:23:in `<main>'

```

Any ideas why this is?

Thank you

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [April 15, 2021, 10:57pm UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/2 "2021-04-15T22:57:05Z")

</div>

Github-Pages uses Jekyll 3.9, which isn’t compatible with Ruby 3. Downgrading to Ruby 2.7 should avoid the problem.

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [April 15, 2021, 11:18pm UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/4 "2021-04-15T23:18:01Z")

</div>

Yes agree to Ruby 2.7. And don’t use plain global `jekyll` which is 4.

Within your project only use `bundle exec jekyll` which 3.9 and that is the appropriate version for GH Pages.

If you still have issues, check your config and frontmatter and any references to paths in your files. It looks like an unexpected data type on your code. But then again it might not be your code and it is a system issue.

If you can move all your content of your repo temporarily to another directory so you only have Gemfile, vendor and an almost empty index.md (not even config), then you can run the serve command there and then you’ll see that Jekyll can work alone. Then start bringing your code back in to the directory and see which file causes a break if at all.

You can also setup a new directory locally to test Jekyll itself using a template

```auto
cd my-repo
bundle exec jekyll new ~/repos/test
cd !$ # Same as cd ~/repos/test

# maybe bundle install steps.
# ...

bundle exec jekyll serve --trace

```

Please provide a repo link too if you figure out that you can get Jekyll to run for a new project but not your existing one.

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [June 12, 2021, 6:56am UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/6 "2021-06-12T06:56:31Z")

</div>

The error is in Jekyll Manager

So disable this line in Gemfile and serve again

```auto
gem 'jekyll-manager', group: :jekyll_plugins

```

Also I recommend deleting Node modules and adding dir to gitignore. You don’t need to add that to git.

---

<div class="post-metadata">

**Author:** ![zuntik](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/zuntik/32/3436_2.png) [@zuntik](https://talk.jekyllrb.com/u/zuntik)\
**Post date:** [June 17, 2021, 7:15am UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/7 "2021-06-17T07:15:46Z")

</div>

Thanks. I installed the appropriate versions.

---

<div class="post-metadata">

**Author:** ![jcubic](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jcubic/32/3859_2.png) [@jcubic](https://talk.jekyllrb.com/u/jcubic)\
**Post date:** [September 3, 2021, 4:40pm UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/8 "2021-09-03T16:40:32Z")

</div>

I have the same error, I don’t use GitHub pages and I don’t have jekyll-manager in Gemfile.

I use:

bundle exec jekyll serve

and Jekyll’s serve doesn’t work. Any tips on how to make it work? Or is deleting Jekyll and use something else the only option? I want to migrate to Eleventy that just works and use Node instead of Ruby that keep adding breaking changes that prevent Jekyll to run.

PS: I use Fedora.

---

<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:** [September 3, 2021, 5:41pm UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/9 "2021-09-03T17:41:55Z")

</div>

I would open a new thread and post your full output and a link to your repo if possible.

Or use something else, keep in mind we’re all just here volunteering to try and help others, no one is going to stop you from trying something else.

---

<div class="post-metadata">

**Author:** ![jcubic](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jcubic/32/3859_2.png) [@jcubic](https://talk.jekyllrb.com/u/jcubic)\
**Post date:** [September 3, 2021, 6:00pm UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/10 "2021-09-03T18:00:46Z")

</div>

It seems it’s not documented but Jekyll doesn’t work fully with Ruby 3.0. At least on Linux because of some dependency:

[https://bbs.archlinux.org/viewtopic.php?id=265534](https://bbs.archlinux.org/viewtopic.php?id=265534)

Mainly `pathutil`.

---

<div class="post-metadata">

**Author:** ![eoli3n](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/eoli3n/32/4915_2.png) [@eoli3n](https://talk.jekyllrb.com/u/eoli3n)\
**Post date:** [October 15, 2022, 10:57pm UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/11 "2022-10-15T22:57:40Z")

</div>

On my distro, I can’t get ruby2.7 easily (void linux).  
When I `bundle exec jekyll serve`, it works, but I get that error and html is not templated, resulting in blank pages.

```auto
➜ bundle exec jekyll serve
Configuration file: /home/user/dev/eoli3n.github.io/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /home/user/dev/eoli3n.github.io
       Destination: /home/user/dev/eoli3n.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
Error reading file /home/user/dev/eoli3n.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-gallery-generator-1.2.3/lib/gallery_page.html: no implicit conversion of Hash into Integer 

Fromages: best_image not found!
Error reading file /home/user/dev/eoli3n.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-gallery-generator-1.2.3/lib/gallery_page.html: no implicit conversion of Hash into Integer 
No EXIF data in photos/oven/oven2.png
No EXIF data in photos/oven/oven.png
No EXIF data in photos/oven/oven3.png
No EXIF data in photos/oven/oven1.png
Oven 6/6 images
Error reading file /home/user/dev/eoli3n.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-gallery-generator-1.2.3/lib/gallery_page.html: no implicit conversion of Hash into Integer 

Pains: best_image not found!
Error reading file /home/user/dev/eoli3n.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-gallery-generator-1.2.3/lib/gallery_page.html: no implicit conversion of Hash into Integer 
Pizzas 64/64 images
Error reading file /home/user/dev/eoli3n.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-gallery-generator-1.2.3/lib/gallery_index.html: no implicit conversion of Hash into Integer 
       Jekyll Feed: Generating feed for posts
                    done in 1.435 seconds.
 Auto-regeneration: enabled for '/home/user/dev/eoli3n.github.io'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

```

Is this that same ruby version problem ?

```bash
➜ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

```

---

<div class="post-metadata">

**Author:** ![kristofhuszar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/kristofhuszar/32/5410_2.png) [@kristofhuszar](https://talk.jekyllrb.com/u/kristofhuszar)\
**Post date:** [July 3, 2023, 12:14am UTC](https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/12 "2023-07-03T00:14:27Z")

</div>

> [@zuntik](#):
>
> `jekyll 3.9.0 | Error: no implicit conversion of Hash into Integer`

The same error has occurred to me after upgrading my system from Debian 11 to 12 (which upgraded Ruby from 2.7 to 3.1).

However, I was able to resolve the issue _without_ reinstalling Ruby 2.7 by following the instructions on [this page](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll#building-your-site-locally) of the GitHub documentation.

In particular, from within the project folder, I first executed `bundle add webrick` (to install a dependency missing from Ruby 3.0 or later), then `bundle update github-pages` (to update all relevant gems). Afterwards `bundle exec jekyll serve` worked for me without any errors.

**Note:** Before coming across the doc-page linked above, as part of the troubleshooting process, I also restored several installed gems to [pristine condition](https://guides.rubygems.org/command-reference/#gem-pristine). In case of the gems with associated executables in the folder `$GEM_HOME/bin` I also added the option `-E` to have their shebangs updated from `#!/usr/bin/env ruby2.7` to `#!/usr/bin/env ruby3.1`. (If Ruby was already installed on your system before those gems, then this step is probably not necessary.)
