I'm running into an issue with my Jekyll/Gulp setup failing, and the message I keep getting is "must use Bundler 2 or greater" even though I have Bundler 2.0.2 installed. There are other questions out there with a similar problem, but those projects were Rails and Heroku based. So far none of the solutions I've found ended up not working for me.
Terminal shows that I have the same version of Bundler installed as what's listed in Gemfile.lock.
fs-217-156:jekyll-gulp mrjandre$ bundler -v
Bundler version 2.0.2
And I'm running Ruby 2.6.5:
fs-217-156:jekyll-gulp mrjandre$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin17]
From Gemfile.lock:
PLATFORMS
ruby
x64-mingw32
DEPENDENCIES
jekyll (~> 3.8.5)
jekyll-feed (~> 0.6)
tzinfo-data
BUNDLED WITH
2.0.2
I've tried uninstalling and reinstalling Bundler and Jekyll at least a dozen times over the last couple of days.
gem uninstall bundler
gem install bundler -v '2.0.2'
gem update --system
bundle update --bundler
No idea what binstubs
are, but I gave this a try too:
bundle binstubs bundler
Results of running 'gulp':
fs-217-156:jekyll-gulp mrjandre$ gulp
[09:48:24] Using gulpfile ~/Desktop/Repos/jekyll-gulp/gulpfile.js
[09:48:24] Starting 'default'...
[09:48:24] Starting 'styles'...
[09:48:25] Finished 'styles' after 928 ms
[09:48:25] Starting 'scripts'...
[09:48:27] Finished 'scripts' after 1.35 s
[09:48:27] Starting 'images'...
[09:48:27] Finished 'images' after 3.84 ms
[09:48:27] Starting 'jekyll-build'...
Traceback (most recent call last):
13: from /usr/local/bin/jekyll:22:in `<main>'
12: from /usr/local/bin/jekyll:22:in `load'
11: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>'
10: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
9: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler.rb:101:in `setup'
8: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler.rb:135:in `definition'
7: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/definition.rb:34:in `build'
6: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/dsl.rb:13:in `evaluate'
5: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/dsl.rb:234:in `to_definition'
4: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/dsl.rb:234:in `new'
3: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/definition.rb:83:in `initialize'
2: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/definition.rb:83:in `new'
1: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
[09:48:27] 'jekyll-build' errored after 612 ms
[09:48:27] Error: exited with error code: 1
at ChildProcess.onexit (/Users/mrjandre/Desktop/Repos/jekyll-gulp/node_modules/end-of-stream/index.js:39:36)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
[09:48:27] 'default' errored after 2.9 s
This is the jekyll-build
task in gulpfile.js
, which is pretty standard:
gulp.task("jekyll-build", function () {
return cp.spawn( jekyll , ["build"], {stdio: "inherit"})
});
I also deleted node_modules
and reinstalled those dependencies a few times, ran npm audit fix
and updated npm as well.
I switch between Mac OSX and Windows 10 often, and this setup has been reliable on both systems for years. Any pointers and suggestions would be greatly appreciated, and I'd be happy to provide additional information if I've missed something.