0

Not sure if this is a bug, but I wasn’t able to find anything on the Web. Everything was working fine using a combination of Grunt, Jekyll and Homebrew to create my website. But once I updated to High Sierra the Jekyll build fails.

The way I usually run Jekyll build is via grunt-shell task like so:

grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),


        shell: {
            jekyllBuild: {
                command: 'jekyll build'
            }
        },
       connect: {
            server: {
                options: {
                    hostname: 'localhost',
                    port: 4000,
                    base: '_build'
                }
            }
        },
...
      watch: {           
            jekyll: {
                options: {
                    livereload: true
                },
                files: [
                    '**/*.scss',
                    '**/*.html',
                    '**/*.js', 
                    // The negations must go after
                    '!*node_modules/**',
                    '!*_build/**',
                    '*.md', 
                    '*.yml',   
                    'img/**',
                    ],
                tasks: ['shell:jekyllBuild','postcss']
            }
        }
    });

...

grunt.registerTask('serve', ['shell','connect','watch']);

Which gives the following error:

Running "shell:jekyllBuild" (shell) task
Configuration file: [URL]/_config.yml
            Source: [URL]
       Destination: _build
 Incremental build: disabled. Enable with --incremental
      Generating... 
jekyll 3.6.0 | Error:  negative argument
Warning: Command failed: jekyll build
 Use --force to continue.

Aborted due to warnings.

Everything else I run works except Jekyll.

I also tried just running jekyll build without shell task but still got an error:

jekyll 3.6.0 | Error:  negative argument
Warning: Command failed: jekyll build
 Use --force to continue.

Aborted due to warnings.

I am using Homebrew to keep things local and everything seems to be in the correct location:

~$ which jekyll
/usr/local/bin/jekyll
~$ which ruby
/usr/local/bin/ruby
~$ which grunt
[URL]/.npm-packages/bin/grunt
~$ which gem
/usr/local/bin/gem
~$ which node
/usr/local/bin/node

I realize, my setup may not be the best, but it was working so I'm hoping for some guidance. I was not the one to initially create this setup and I'm not a programmer but rather a web designer who can hack things together to my own detriment at times :)

bfontaine
  • 18,169
  • 13
  • 73
  • 107
  • 1
    Is the error coming from grunt or jekyll? Did you try to run `jekyll build` manually? If so, did that work? – Casper Sep 28 '17 at 22:03
  • 1
    I would keep my setup simpler (fewer things to break) by ditching grunt. – Mr. Hugo Sep 28 '17 at 22:04
  • @Casper yes I did, and get the same error. I've also had some help on the Jekyll repo and they seem to think it could be one of my plugins: https://github.com/jekyll/jekyll/issues/6393 – Ryan Garcia Sep 29 '17 at 00:12
  • @JoostS I would love a simpler set up. Do you have a link to something describing such a thing. I'm looking to run it mainly locally and some form of live reload if possible. I went for homebrew thinking it would be simpler. I do have quite a few grunt tasks for SVG and img optimization which is why I haven't ditched it. – Ryan Garcia Sep 29 '17 at 00:13
  • @Casper it does seem to be the plugin. I deleted all the code within it and everything started working again. I will need to make sure how removing that plugin affects other things however. For now that seems the best explanation and I'm not sure why after a few years of using this set up it started interfering with the build. – Ryan Garcia Sep 29 '17 at 00:29
  • Ok. Good that you got some help. Now you have the problem isolated it helps in the future if you want to post questions again about that plugin specifically. That's the basics of troubleshooting: always simplify the setup until you find the problem, then it becomes easier to focus on where and how to solve it. Now you can open an issue at the plugin maintainer instead, if you think the bug is there. – Casper Sep 29 '17 at 00:41
  • @Casper SVG and img optimization can wait until you finish your website (do them once) or you can let a CDN handle this. Live reload can probably be achieved through a browser-plugin. IMHO there is no need for a complicated setup (just yet). – Mr. Hugo Sep 29 '17 at 07:46
  • I don’t understand the "I am using Homebrew to keep things local" part; Homebrew installs stuff under `/usr/local`, so that’s in a global location. – bfontaine Sep 29 '17 at 12:27
  • 1
    Thanks @Casper the issue ended up being the plugin. The plugin made all links automatically root relative regardless of location. I can't recall why we did it this way, maybe we couldn't find a way via Jekyll default alone. Unfortunately, now that the plugin is out of commission while it all works locally, all links break on the test server because the folder structure is deeper if that makes sense. I will have to submit as a different issue. That said, something did change for the plugin to no longer work all of the sudden. – Ryan Garcia Sep 29 '17 at 17:15
  • @bfontaine I don't quite understand it either. I started using Homebrew mainly because I read about it as a convenient way to maintain and update my set up. One of the things I got from it is that instead of downloading things for the entire system it would localize them into /usr/local/bin or whatever folder you wanted. I don't fully understand it, but it's done the job so far lol! – Ryan Garcia Sep 29 '17 at 17:19
  • @RyanGarcia Ok I understand. – bfontaine Sep 29 '17 at 17:36
  • @RyanGarcia Ok. Got it. Thanks for the update. – Casper Sep 29 '17 at 22:28

1 Answers1

0

The issue ended up not being related to OS update, but rather a custom Jekyll plugin that was causing the issue. Once the plugin was removed everything worked. However, something did change perhaps in Jekyll or elsewhere to make the plugin not work all of the sudden. I will open a separate issue to figure that out. Thanks @Casper and @JoostS for quick responses.