Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String does not have #dig method (TypeError) #181

Open
WCY-dt opened this issue Dec 7, 2024 · 2 comments
Open

String does not have #dig method (TypeError) #181

WCY-dt opened this issue Dec 7, 2024 · 2 comments

Comments

@WCY-dt
Copy link

WCY-dt commented Dec 7, 2024

trace:

                    ------------------------------------------------
      Jekyll 4.3.4   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives/archive.rb:58:in `dig': String does not have #dig method (TypeError)

          @config.dig("layouts", type) || @config["layout"]
                      ^^^^^^^^^^^^^^^
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives/archive.rb:58:in `layout'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives/archive.rb:41:in `initialize'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives.rb:64:in `new'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives.rb:64:in `block in read_tags'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives.rb:63:in `each'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives.rb:63:in `read_tags'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives.rb:56:in `read'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-archives-2.3.0/lib/jekyll-archives.rb:48:in `generate'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/site.rb:193:in `block in generate'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/site.rb:191:in `each'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/site.rb:191:in `generate'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/site.rb:79:in `process'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/command.rb:28:in `process_site'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/commands/build.rb:65:in `build'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/commands/build.rb:36:in `process'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/command.rb:91:in `each'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from C:/Users/83442/.local/share/gem/ruby/3.3.0/gems/jekyll-4.3.4/exe/jekyll:15:in `<top (required)>'
        from C:/Users/83442/AppData/Local/Microsoft/WindowsApps/jekyll:25:in `load'
        from C:/Users/83442/AppData/Local/Microsoft/WindowsApps/jekyll:25:in `<main>'
@WCY-dt
Copy link
Author

WCY-dt commented Dec 7, 2024

Solved. I found that I had mistakenly written layout as layouts in the config file. Strangely, this worked fine in ruby ​​3.2. I upgraded ruby ​​to version 3.3 today and it went wrong.

@ashmaroli
Copy link
Member

Hello @WCY-dt,
I doubt the issue is in Ruby. Basically, the error message means that the top-level jekyll-archives config setting should be a hash of key-value pairs instead of a string. If layouts instead of layout throws that same error, then there is a bug that needs to be fixed. Do let us know if you can reproduce the bug again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants