hologram icon indicating copy to clipboard operation
hologram copied to clipboard

Not finding rails config when parsing erb files

Open addbrick opened this issue 9 years ago • 2 comments

I am not sure if I am describing this correctly so let me know if anything needs clarification.

I have a rails app that is using scss, coffee, and haml. I set up hologram following the readme and pivotal labs post (did not set up grunt).

this is my config file

source: ./app/assets
destination: ./public/styleguide
documentation_assets: ./doc_assets
dependencies:
  - ./build
index: basics
nav_level: all

Some of my .erb files reference Settings which is created by the rails_config gem. Everytime I run bundle exec hologram I get the following error

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):8:in `get_binding': uninitialized constant Hologram::TemplateVariables::Settings (NameError)
    from /Users/addbrick/.rbenv/versions/2.1.2/lib/ruby/2.1.0/erb.rb:850:in `eval'
    from /Users/addbrick/.rbenv/versions/2.1.2/lib/ruby/2.1.0/erb.rb:850:in `result'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:247:in `write_erb'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:197:in `block in write_docs'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `each'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:185:in `write_docs'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:147:in `build_docs'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/lib/hologram/doc_builder.rb:87:in `build'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/lib/hologram/cli.rb:38:in `build'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/lib/hologram/cli.rb:30:in `run'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/gems/hologram-1.4.0/bin/hologram:6:in `<top (required)>'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/bin/hologram:23:in `load'
    from /Users/addbrick/Mightybell/speckel/vendor/bundle/ruby/2.1.0/bin/hologram:23:in `<main>'

It looks like my Settings are not being loaded. I am not sure how to get them to load or why they are not loading in the first place. Any help is appreciated. If I am using it wrong please let me know.

addbrick avatar Jul 10 '15 00:07 addbrick

One thing I noticed was that I didn't want to worry about the Javascript-related things, so I just set my source: ./app/assets/stylesheets and that got everything to work

acconrad avatar Jul 22 '15 16:07 acconrad

One of my stylesheets is an .erb which can't change. Sad times

addbrick avatar Jul 22 '15 17:07 addbrick