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

Error: undefined method `default_proc=' for #<String:0x00000101e45e88> #3643

Closed
tomdavenport opened this Issue Apr 7, 2015 · 11 comments

Comments

Projects
None yet
5 participants
@tomdavenport

tomdavenport commented Apr 7, 2015

Hi, not entirely sure if this is a bug with Jekyll or my system, but Google is serving no results so trying for feedback here.

Normally running jekyll serve --watch runs fine, but today I got this as a result:

jekyll 2.5.1 | Error: undefined method``default_proc=' for #<String:0x00000101e45e88>

Any ideas what is up? Is this a bug or something else?

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Apr 7, 2015

Member

Please run again with --trace to get the full output. Are you using any plugins?

Member

parkr commented Apr 7, 2015

Please run again with --trace to get the full output. Are you using any plugins?

@parkr parkr added the support label Apr 7, 2015

@tomdavenport

This comment has been minimized.

Show comment
Hide comment
@tomdavenport

tomdavenport Apr 7, 2015

/Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/page.rb:35:in `initialize': undefined method `default_proc=' for #<String:0x0000010179eb98> (NoMethodError)
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:178:in `new'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:178:in `block in read_directories'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:172:in `each'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:172:in `read_directories'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:151:in `read'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:49:in `process'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/command.rb:28:in `process_site'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/commands/build.rb:56:in `build'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/commands/build.rb:34:in `process'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `call'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `each'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `execute'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/program.rb:35:in `go'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary.rb:22:in `program'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/bin/jekyll:20:in `<top (required)>'
    from /Users/tom/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `load'
    from /Users/tom/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `<main>'
    from /Users/tom/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/tom/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

Only plugin is Reading Time but that has worked fine for ages.

Recently tried installing JAPR (the asset pipeline plugin) but abandoned while trying the Google Pagespeed tool on my server.

tomdavenport commented Apr 7, 2015

/Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/page.rb:35:in `initialize': undefined method `default_proc=' for #<String:0x0000010179eb98> (NoMethodError)
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:178:in `new'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:178:in `block in read_directories'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:172:in `each'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:172:in `read_directories'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:151:in `read'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/site.rb:49:in `process'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/command.rb:28:in `process_site'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/commands/build.rb:56:in `build'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/commands/build.rb:34:in `process'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `call'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `each'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `execute'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary/program.rb:35:in `go'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.4/lib/mercenary.rb:22:in `program'
    from /Users/tom/.rvm/gems/ruby-2.1.1/gems/jekyll-2.5.1/bin/jekyll:20:in `<top (required)>'
    from /Users/tom/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `load'
    from /Users/tom/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `<main>'
    from /Users/tom/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/tom/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

Only plugin is Reading Time but that has worked fine for ages.

Recently tried installing JAPR (the asset pipeline plugin) but abandoned while trying the Google Pagespeed tool on my server.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Apr 7, 2015

Member

Super weird. Looks like one of your pages has invalid yaml. What did you edit recently?

The property it's trying to affect is Page.data, which should be a Hash, not a String.

Member

parkr commented Apr 7, 2015

Super weird. Looks like one of your pages has invalid yaml. What did you edit recently?

The property it's trying to affect is Page.data, which should be a Hash, not a String.

@tomdavenport

This comment has been minimized.

Show comment
Hide comment
@tomdavenport

tomdavenport Apr 8, 2015

Great, it was me doing a dumb 'replace all' on colons in the body, but this screwed up the YAML. Thanks for your help 👍

tomdavenport commented Apr 8, 2015

Great, it was me doing a dumb 'replace all' on colons in the body, but this screwed up the YAML. Thanks for your help 👍

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks Apr 8, 2015

Contributor

I think your problem might be a testament to our need to be more verbose with YAML issues. We can readily detect them and pass the error out without verbosity enabled can we not @parkr?

Contributor

envygeeks commented Apr 8, 2015

I think your problem might be a testament to our need to be more verbose with YAML issues. We can readily detect them and pass the error out without verbosity enabled can we not @parkr?

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Apr 8, 2015

Member

we could detect if !data.is_a? Hash pretty simply and say something like path/to/page.html has invalid YAML front matter. Please fix

Member

parkr commented Apr 8, 2015

we could detect if !data.is_a? Hash pretty simply and say something like path/to/page.html has invalid YAML front matter. Please fix

@tomdavenport

This comment has been minimized.

Show comment
Hide comment
@tomdavenport

tomdavenport Apr 8, 2015

That would work, I have limited experience and even something that simple would make the solution obvious to me.

On 8 Apr 2015, at 21:01, Parker Moore notifications@github.com wrote:

we could detect if !data.is_a? Hash pretty simply and say something like path/to/page.html has invalid YAML front matter. Please fix


Reply to this email directly or view it on GitHub #3643 (comment).

tomdavenport commented Apr 8, 2015

That would work, I have limited experience and even something that simple would make the solution obvious to me.

On 8 Apr 2015, at 21:01, Parker Moore notifications@github.com wrote:

we could detect if !data.is_a? Hash pretty simply and say something like path/to/page.html has invalid YAML front matter. Please fix


Reply to this email directly or view it on GitHub #3643 (comment).

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Apr 9, 2015

Member

Want to submit a PR?

Member

parkr commented Apr 9, 2015

Want to submit a PR?

@tomdavenport

This comment has been minimized.

Show comment
Hide comment
@tomdavenport

tomdavenport Apr 9, 2015

I have no idea how to set up the detection.

On 9 Apr 2015, at 02:07, Parker Moore notifications@github.com wrote:

Want to submit a PR?


Reply to this email directly or view it on GitHub #3643 (comment).

tomdavenport commented Apr 9, 2015

I have no idea how to set up the detection.

On 9 Apr 2015, at 02:07, Parker Moore notifications@github.com wrote:

Want to submit a PR?


Reply to this email directly or view it on GitHub #3643 (comment).

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Apr 10, 2015

Member

In the read_yaml method in convertible.rb, we'd probably check the value of self.data. If it's not a Hash, we'd print the appropriate error message and fail (Jekyll.logger.abort_with "Error:", "Invalid YAML front matter in index.html")

Member

parkr commented Apr 10, 2015

In the read_yaml method in convertible.rb, we'd probably check the value of self.data. If it's not a Hash, we'd print the appropriate error message and fail (Jekyll.logger.abort_with "Error:", "Invalid YAML front matter in index.html")

@Allianzcortex

This comment has been minimized.

Show comment
Hide comment
@Allianzcortex

Allianzcortex Oct 15, 2015

I ever met the same questions,just because the lack of space during the YAML files. such like layout:post should be changed into **layout: post".May this will help someone.

Allianzcortex commented Oct 15, 2015

I ever met the same questions,just because the lack of space during the YAML files. such like layout:post should be changed into **layout: post".May this will help someone.

@parkr parkr referenced this issue Jan 27, 2016

Closed

Refactor Errors #4310

0 of 6 tasks complete

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.