trulia / hologram

A markdown based documentation system for style guides.
http://trulia.github.io/hologram
Other
2.16k stars 199 forks source link

Weird error ... #218

Closed kevinkashou closed 7 years ago

kevinkashou commented 9 years ago

I am getting this error when trying to render out hologram ...


(erb):32:in `block in get_binding': undefined method `split' for nil:NilClass (NoMethodError)
    from (erb):31:in `each'
    from (erb):31:in `get_binding'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:849:in `eval'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:849:in `result'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:243:in `write_page'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:199:in `block in write_docs'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `write_docs'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:147:in `build_docs'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:87:in `build'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/lib/hologram/cli.rb:38:in `build'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/lib/hologram/cli.rb:30:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/hologram-1.4.0/bin/hologram:6:in `'
    from /usr/bin/hologram:23:in `load'
    from /usr/bin/hologram:23:in `
'

What does this typically means?

Thanks

jdcantrell commented 9 years ago

I get this when I reference a variable in my header or footer template that is nil. Are you on hologram 1.4? And can you share the tpl that's causing the error?

kevinkashou commented 9 years ago

I am using the latest hologram and the template file and header are the same when I used hologram init.

Sent from my iPhone

On Apr 3, 2015, at 1:44 PM, JD Cantrell notifications@github.com wrote:

I get this when I reference a variable in my header or footer template that is nil. Are you on hologram 1.4? And can you share the tpl that's causing the error?

— Reply to this email directly or view it on GitHub https://github.com/trulia/hologram/issues/218#issuecomment-89413459.

jdcantrell commented 9 years ago

Ah thanks! I'll look at it this evening.

kevinkashou commented 9 years ago

That would be great thanks :)

kevinkashou commented 9 years ago

Any update? It works on perfectly fine on one machine but not the machine that I need it to work on.

d2s commented 9 years ago

I had similar error after I updated to latest hologram 1.4.0 version.

» bundle exec hologram       
Custom markdown renderer Cortanamarkdownrenderer loaded.
Adding renderer for haml examples
Adding renderer for html examples
Adding renderer for js examples
Adding renderer for jsx examples
Adding renderer for react examples
Adding renderer for slim examples
(erb):32:in `block in get_binding': undefined method `split' for nil:NilClass (NoMethodError)
    from (erb):31:in `each'
    from (erb):31:in `get_binding'
    from /Users/d2s/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/erb.rb:863:in `eval'
    from /Users/d2s/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/erb.rb:863:in `result'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:243:in `write_page'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:199:in `block in write_docs'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `each'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `write_docs'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:147:in `build_docs'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:87:in `build'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/lib/hologram/cli.rb:38:in `build'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/lib/hologram/cli.rb:30:in `run'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/gems/hologram-1.4.0/bin/hologram:6:in `<top (required)>'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/bin/hologram:23:in `load'
    from /Users/d2s/<<project_path_hidden>>/vendor/ruby/2.2.0/bin/hologram:23:in `<main>'

Didn't have time to debug cause of the problem, so decided to just switch the old version back to the Gemfile.

gem 'hologram', '~>1.3.0'

Would be nice to have this fixed.

kevinkashou commented 9 years ago

That did the trick! Thank you so much!

jdcantrell commented 9 years ago

Haha, let's leave this open, I'll get this fixed in 1.4

ain commented 9 years ago

Reproduced. Same for me and also reported at jchild3rs/grunt-hologram#10.

GeorgMeyer23 commented 9 years ago

+1

GaryJones commented 9 years ago

For a client site, I narrowed it down to the index: line in the config file.

Previously, I had index: README as I wanted it to read the README.md file in my sources directory. With previous versions of Hologram, that worked perfectly. 1.4.0 must have changed something.

I renamed README.md to index.md (as that is the fallback file name mentioned in the example config file), and commented out the index: line. Now builds fine on 1.4.0.

rafhun commented 9 years ago

I can confirm @GaryJones solution, commenting out the index: README line from the config worked for me too. Before I would get the same error.

sebastian-marinescu commented 8 years ago

Commenting out the index-line also worked for me :+1:

ain commented 7 years ago

Not sure why this ticket has been closed.

1.4.0 is a minor release. If index: README worked in 1.3.*, this ticket should be treated as bug and a fix should follow in 1.4.*, because breaking change should have been released in 2.* not 1.4.0.