jekyll / jekyll-sass-converter

A Sass converter for Jekyll.

Home Page:http://rubygems.org/gems/jekyll-sass-converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on jekyll serve: Jekyll::Converters::Scss - undefined method `to_sym' for true:TrueClass Did you mean? to_s

dellagustin opened this issue · comments

My Environment

Software Version(s)
Operating System docker image based on ruby:2.7.0-alpine3.11
jekyll 4.0.0
jekyll-sass-converter 2.0.1
github-pages N/A (running locally)

I'm using docker toolbox on Windows 10 Home

Expected Behaviour

Current Behavior

When I run the jekyll serve command, I see the following error:

  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/atom.scss':
                    undefined method `to_sym' for true:TrueClass Did you mean? to_s
                    ------------------------------------------------
      Jekyll 4.0.0   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace.
                    ------------------------------------------------
Traceback (most recent call last):
        30: from /usr/local/bundle/bin/jekyll:23:in `<main>'
        29: from /usr/local/bundle/bin/jekyll:23:in `load'
        28: from /usr/local/bundle/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
        27: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        26: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
        25: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
        24: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
        23: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
        22: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        21: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
        20: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
        19: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
        18: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:36:in `process'
        17: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:65:in `build'
        16: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:28:in `process_site'
                     for any additional information or backtrace.
                    ------------------------------------------------
Traceback (most recent call last):
        30: from /usr/local/bundle/bin/jekyll:23:in `<main>'
        29: from /usr/local/bundle/bin/jekyll:23:in `load'
        28: from /usr/local/bundle/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
        27: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        26: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
        25: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
        24: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
        23: from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
        22: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        21: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
        20: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
        19: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
        18: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:36:in `process'
        17: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:65:in `build'
        16: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:28:in `process_site'
        15: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:76:in `process'
        13: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:515:in `render_pages'
        12: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:515:in `each'
        11: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:516:in `block in render_pages'
        10: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:523:in `render_regenerated'
         9: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:63:in `run'
         8: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:84:in `render_document'
         7: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:100:in `convert'
         6: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:100:in `reduce'
         5: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:100:in `each'
         4: from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:102:in `block in convert'
/usr/local/bundle/gems/jekyll-sass-converter-2.0.1/lib/jekyll/converters/scss.rb:224:in `sourcemap_option': undefined method `to_sym' for true:TrueClass (NoMethodError)
Did you mean?  to_s

Code Sample

I prepared a branch that demonstrates the issue: https://github.com/dellagustin/innersourcecommons.org/tree/bug-report__converters-scss-undefined-method-to_sym

To reproduce the error, clone the repo and checkout the branch bug-report__converters-scss-undefined-method-to_sym

You will need docker installed.

Build the image with the command:

  • docker build .

The run command should serve the page from the root of the directory:

  • docker run --rm -it -v <your directory>:/source <image id>

<your source directory> is a bit tricky on docker toolbox, I entered the path based on shared folder with the Virtual Box VM (i.e. /c/User/<your user>/git repo folder)
Some fore info on how to pass the current folder for other docker setups can be found here: https://stackoverflow.com/questions/41485217/mount-current-directory-as-a-volume-in-docker-on-windows-10

Nevermind, I found an error in our development config file:

sass:
  # http://sass-lang.com/documentation/file.SASS_REFERENCE.html#output_style
  style: :expanded
  line_numbers: true
  # trace_selectors: true
  # debug_info: true
  # FUTURE https://github.com/jekyll/jekyll-sass-converter/issues/12
  sourcemap: true

the sourcemap config for sass had a value that is not accepted.
the accepted ones according to your README.md are never, always and develpment: https://github.com/jekyll/jekyll-sass-converter/blob/b044e9e3ad9ed9ce647fab76c621aeaa89775999/README.md

You may want to have some error handling to put a text explaining the value is not acceptable.