benbalter / jekyll-remote-theme

Jekyll plugin for building Jekyll sites with any GitHub-hosted theme
MIT License
291 stars 78 forks source link

`configure_theme': undefined method `configure_sass' (NoMethodError) #60

Closed pmpinto closed 4 years ago

pmpinto commented 5 years ago

Describe the bug

Can't build or serve with jekyll-remote-theme due to a NoMethodError.

Steps to reproduce the behavior

  1. Generate a new Jekyll site
  2. Add jekyll-remote-theme under plugins in _config.yml
  3. Add gem "jekyll-remote-theme", github: "benbalter/jekyll-remote-theme", branch: "master" in Gemfile (refer to #58 if needed)
  4. Run bundle install
  5. Add a remote_theme in _config.yml, for instance pmpinto/jekyll-mero
  6. Run bundle exec jekyll serve --trace

Expected behavior

I expected the site to build with the mentioned theme.

Screenshots

Trace
$ bundle exec jekyll build --trace
Configuration file: /Users/pmpinto/Git/my-awesome-site/_config.yml
            Source: /Users/pmpinto/Git/my-awesome-site
       Destination: /Users/pmpinto/Git/my-awesome-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
      Remote Theme: Using theme pmpinto/jekyll-mero
/Users/pmpinto/.rvm/gems/ruby-2.4.0/bundler/gems/jekyll-remote-theme-bb9eecf879c0/lib/jekyll-remote-theme/munger.rb:55:in `configure_theme': undefined method `configure_sass' for # (NoMethodError)
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/bundler/gems/jekyll-remote-theme-bb9eecf879c0/lib/jekyll-remote-theme/munger.rb:26:in `munge!'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/bundler/gems/jekyll-remote-theme-bb9eecf879c0/lib/jekyll-remote-theme.rb:27:in `init'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/bundler/gems/jekyll-remote-theme-bb9eecf879c0/lib/jekyll-remote-theme.rb:33:in `block in '
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/hooks.rb:102:in `block in trigger'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/hooks.rb:101:in `each'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/hooks.rb:101:in `trigger'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/site.rb:114:in `reset'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/site.rb:73:in `process'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:28:in `process_site'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:65:in `build'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:36:in `process'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/gems/jekyll-4.0.0/exe/jekyll:15:in `'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/bin/jekyll:23:in `load'
    from /Users/pmpinto/.rvm/gems/ruby-2.4.0/bin/jekyll:23:in `
' from /Users/pmpinto/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:24:in `eval' from /Users/pmpinto/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:24:in `
'
benbalter commented 5 years ago

WIP Jekyll 4.0 support in https://github.com/benbalter/jekyll-remote-theme/pull/61

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

eddarmitage commented 4 years ago

Might this now be fixed now #61 has been merged - it just needs a release?

RobbiNespu commented 4 years ago

Getting same error message:

$ bundle exec jekyll build --profile -t
Configuration file: D:/NOPE/robbinespu.gitlab.io/_config.yml
            Source: D:/NOPE/robbinespu.gitlab.io
       Destination: D:/NOPE/robbinespu.gitlab.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
      Remote Theme: Using theme yukaii/octoflavor
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-remote-theme-0.4.1/lib/jekyll-remote-theme/munger.rb:55:in `configure_theme': undefined method `configure_sass' for #<Jekyll::RemoteTheme::Theme:0x0000000006f21c40> (NoMethodError)
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-remote-theme-0.4.1/lib/jekyll-remote-theme/munger.rb:26:in `munge!'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-remote-theme-0.4.1/lib/jekyll-remote-theme.rb:27:in `init'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/jekyll-remote-theme-0.4.1/lib/jekyll-remote-theme.rb:33:in `block in <top (required)>'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/hooks.rb:102:in `block in trigger'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/hooks.rb:101:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/hooks.rb:101:in `trigger'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/site.rb:114:in `reset'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/site.rb:73:in `process'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/command.rb:28:in `process_site'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/commands/build.rb:65:in `build'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/commands/build.rb:36:in `process'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/command.rb:89:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-b2639ceb59c6/exe/jekyll:15:in `<top (required)>'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `load'
        from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `<main>'
hszhakka commented 4 years ago

As @benbalter already mentioned, this bug is fixed in #61, but the new version is not yet to release. However, we can resolve this problem locally.

First, find out the location of jekyll-remote-theme in your computer by running the below command.

$ gem which jekyll-remote-theme
/Users/xxxx/.rvm/gems/ruby-2.6.5/gems/jekyll-remote-theme-0.4.1/lib/jekyll-remote-theme.rb

Then open the below file.

/Users/xxxx/.rvm/gems/ruby-2.6.5/gems/jekyll-remote-theme-0.4.1/lib/jekyll-remote-theme/munger.rb

Locate to the 55th line:

site.theme.configure_sass

Replace it with

site.theme.configure_sass if site.theme.respond_to?(:configure_sass)

Save it and run jekyll build again, you would see that all things are good.