ggreer / jekyll-gallery-generator

A Jekyll plugin that generates photo galleries from directories full of images.
Apache License 2.0
367 stars 68 forks source link

Error: no implicit conversion of Hash into Integer #46

Open eoli3n opened 2 years ago

eoli3n commented 2 years ago

Started to talk about it here : https://talk.jekyllrb.com/t/error-no-implicit-conversion-of-hash-into-integer/5890/11

On latest Void Linux

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

Use jekyll on github with custom plugins

Following https://surdu.me/2020/02/04/jekyll-git-hook.html

Init

$ bundle add webrick
$ bundler install
$ git checkout gh-pages
$ rm -rf *
$ git add -A
$ git commit -m "Initialized gh-pages branch"
$ git push
$ cat < EOF > .git/hooks/pre-push
#!/bin/bash

# If any command fails in the bellow script, exit with error
set -e

# Set the name of the folder that will be created in the parent
# folder of your repo folder, and which will temporarily
# hold the generated content.
temp_folder="_gh-pages-temp"

# Make sure our main code runs only if we push the main branch
if [ "$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)" == "main" ]
then
    # Store the last commit message from main branch
    last_message=$(git show -s --format=%s main)

    # Build our Jekyll site
    bundle exec jekyll build

    # Move the generated site in our temp folder
    mv _site ../${temp_folder}

    # Checkout the gh-pages branch and clean it's contents
    git checkout gh-pages
    rm -rf *

    # Copy the site content from the temp folder and remove the temp folder
    cp -r ../${temp_folder}/* .
    rm -rf ../${temp_folder}

    # Commit and push our generated site to GitHub
    git add -A
    git commit -m "Built \`$last_message\`"
    git push

    # Go back to the main branch
    git checkout main
else
    echo "Not main branch. Skipping build"
fi
EOF

Run

$ bundle install
Using concurrent-ruby 1.1.10
Using i18n 0.9.5
Using minitest 5.16.3
Using thread_safe 0.3.6
Using tzinfo 1.2.10
Using zeitwerk 2.6.1
Using activesupport 6.0.6
Using public_suffix 4.0.7
Using addressable 2.8.1
Using bundler 2.3.23
Using coffee-script-source 1.11.1
Using execjs 2.8.1
Using coffee-script 2.4.1
Using colorator 1.1.0
Using commonmarker 0.23.6
Using unf_ext 0.0.8.2
Using unf 0.1.4
Using simpleidn 0.2.1
Using dnsruby 1.61.9
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using em-websocket 0.5.3
Using ffi 1.15.5
Using ethon 0.15.0
Using exifr 1.3.10
Using faraday-net_http 3.0.1
Using ruby2_keywords 0.0.5
Using faraday 2.6.0
Using forwardable-extended 2.6.0
Using gemoji 3.0.1
Using sawyer 0.9.2
Using octokit 4.25.1
Using typhoeus 1.4.0
Using github-pages-health-check 1.17.9
Using rb-fsevent 0.11.2
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using listen 3.7.1
Using jekyll-watch 2.2.1
Using rexml 3.2.5
Using kramdown 2.3.2
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Using rouge 3.26.0
Using safe_yaml 1.0.5
Using jekyll 3.9.2
Using jekyll-avatar 0.7.0
Using jekyll-coffeescript 1.1.1
Using jekyll-commonmark 1.4.0
Using jekyll-commonmark-ghpages 0.2.0
Using jekyll-default-layout 0.1.4
Using jekyll-feed 0.15.1
Using jekyll-gist 1.5.0
Using jekyll-github-metadata 2.13.0
Using jekyll-include-cache 0.2.1
Using racc 1.6.0
Using nokogiri 1.13.8 (x86_64-linux)
Using html-pipeline 2.14.3
Using jekyll-mentions 1.6.0
Using jekyll-optional-front-matter 0.3.2
Using jekyll-paginate 1.1.0
Using jekyll-readme-index 0.3.0
Using jekyll-redirect-from 0.16.0
Using jekyll-relative-links 0.6.1
Using rubyzip 2.3.2
Using jekyll-remote-theme 0.4.3
Using jekyll-seo-tag 2.8.0
Using jekyll-sitemap 1.4.0
Using jekyll-swiss 1.0.0
Using jekyll-theme-architect 0.2.0
Using jekyll-theme-cayman 0.2.0
Using jekyll-theme-dinky 0.2.0
Using jekyll-theme-hacker 0.2.0
Using jekyll-theme-leap-day 0.2.0
Using jekyll-theme-merlot 0.2.0
Using jekyll-theme-midnight 0.2.0
Using jekyll-theme-minimal 0.2.0
Using jekyll-theme-modernist 0.2.0
Using jekyll-theme-primer 0.6.0
Using jekyll-theme-slate 0.2.0
Using jekyll-theme-tactile 0.2.0
Using jekyll-theme-time-machine 0.2.0
Using jekyll-titles-from-headings 0.5.3
Using jemoji 0.12.0
Using kramdown-parser-gfm 1.1.0
Using minima 2.5.1
Using unicode-display_width 1.8.0
Using terminal-table 1.8.0
Using github-pages 227
Using rmagick 4.1.2
Using jekyll-gallery-generator 1.2.3
Using webrick 1.7.0
Bundle complete! 6 Gemfile dependencies, 95 gems now installed.
Bundled gems are installed into `./vendor/bundle`

$ 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/_layouts/gallery_page.html: no implicit conversion of Hash into Integer 
Camembert 18/18 images
Error reading file /home/user/dev/eoli3n.github.io/_layouts/gallery_page.html: no implicit conversion of Hash into Integer 
Respectus Panis 43/43 images
Error reading file /home/user/dev/eoli3n.github.io/_layouts/gallery_index.html: no implicit conversion of Hash into Integer 
       Jekyll Feed: Generating feed for posts
                    done in 1.8 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.
eoli3n commented 2 years ago

It's working well with ruby 2.7.5