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 :)
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.