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

get_binding error #244

Open
andyra opened this issue Jul 29, 2015 · 8 comments
Open

get_binding error #244

andyra opened this issue Jul 29, 2015 · 8 comments

Comments

@andyra
Copy link

andyra commented Jul 29, 2015

I ran hologram init and followed the quick start guide and ran Hologram, but I'm getting the following error: (erb):3:in ‘get_binding’: uninitialized constant Hologram::TemplateVariables::Rails (NameError). Any idea what could be causing this?

Using Ruby 2.1.5 and Rails 4.1.5

@andyra
Copy link
Author

andyra commented Aug 10, 2015

Here's the full error:

$ hologram
/usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rouge-1.9.1/lib/rouge/lexers/shell.rb:20: warning: already initialized constant Rouge::Lexers::Shell::KEYWORDS
/usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rouge-1.9.1/lib/rouge/lexers/shell.rb:20: warning: previous definition of KEYWORDS was here
/usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rouge-1.9.1/lib/rouge/lexers/shell.rb:25: warning: already initialized constant Rouge::Lexers::Shell::BUILTINS
/usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rouge-1.9.1/lib/rouge/lexers/shell.rb:25: warning: previous definition of BUILTINS was here
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):3:in `get_binding': uninitialized constant Hologram::TemplateVariables::Rails (NameError)
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/2.1.0/erb.rb:850:in `eval'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/2.1.0/erb.rb:850:in `result'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:236:in `write_erb'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:197:in `block in write_docs'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `each'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `write_docs'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:147:in `build_docs'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:87:in `build'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/lib/hologram/cli.rb:38:in `build'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/lib/hologram/cli.rb:30:in `run'
    from /usr/local/opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hologram-1.4.0/bin/hologram:6:in `<top (required)>'
    from /usr/local/opt/rbenv/versions/2.1.5/bin/hologram:23:in `load'
    from /usr/local/opt/rbenv/versions/2.1.5/bin/hologram:23:in `<main>'

@andyra
Copy link
Author

andyra commented Aug 10, 2015

Note: hologram works OK in a different project I'm using with Ruby 2.2.2

@jdcantrell
Copy link
Contributor

Hmm, I don't understand how Rails is affecting Hologram. I've installed ruby 2.1.5 and rails 4.1.5 but am still able to build without error. Have you made changes to the header or footer templates?

@andyra
Copy link
Author

andyra commented Aug 13, 2015

Nope, I didn't edit the header or footer templates—they're in their default states after hologram init.

@lawwantsin
Copy link

I'm having this issue. Any fix?

@andyra
Copy link
Author

andyra commented Jan 24, 2016

Sorry, @lawwantsin, I was never able to find a solution.

@kpingel
Copy link

kpingel commented Mar 14, 2016

I'm also having this issue... disheartening to see no solution so long after the original post. 😕

@KaraAJC
Copy link

KaraAJC commented May 21, 2018

Having a similar issue, recently updated to Rails 5.2 and using webpacker:

Adding renderer for slim examples
Adding renderer for react examples
Adding renderer for html examples
Adding renderer for haml examples
Adding renderer for js examples
Adding renderer for jsx examples
W, [2018-05-21T17:57:31.865534 #18147]  WARN -- Skylight: [SKYLIGHT] [2.0.1] Running Skylight in development mode. No data will be reported until you deploy your app.
(To disable this message for all local apps, run `skylight disable_dev_warning`.)
Adding renderer for haml examples
bundler: failed to load command: hologram (/Users/kajc/.rbenv/versions/2.5.1/bin/hologram)
ArgumentError: wrong number of arguments (given 0, expected 1)
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/http/request.rb:59:in `initialize'
  /Users/kajc/projects/CIW/chicago_ideas/styleguide_assets/templates/code_example_renderers/haml.rb:27:in `new'
  /Users/kajc/projects/CIW/chicago_ideas/styleguide_assets/templates/code_example_renderers/haml.rb:27:in `create'
  /Users/kajc/projects/CIW/chicago_ideas/styleguide_assets/templates/code_example_renderers/haml.rb:42:in `instance'
  (erb):13:in `get_binding'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/2.5.0/erb.rb:876:in `eval'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/2.5.0/erb.rb:876:in `result'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:243:in `write_page'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:199:in `block in write_docs'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `each'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `write_docs'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:147:in `build_docs'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:87:in `build'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/lib/hologram/cli.rb:38:in `build'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/lib/hologram/cli.rb:30:in `run'
  /Users/kajc/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/hologram-1.4.0/bin/hologram:6:in `<top (required)>'
  /Users/kajc/.rbenv/versions/2.5.1/bin/hologram:23:in `load'
  /Users/kajc/.rbenv/versions/2.5.1/bin/hologram:23:in `<top (required)>'

We use haml for our views, I'm looking at how ActionDispatch::TestRequest may have changed to see why it would need an argument.

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

5 participants