Pagination + Jekyll Issue

Howdy good Jekyll folk,

I’m running into a pathing(?) issue with a local build. Jekyll works fine if I run it w/o paginate in the config.yml, but once it’s added I get:

bundler: failed to load command: jekyll (/Users/xxxxx/code/xxxxx/bundle/cache/ruby/2.3.0/bin/jekyll)

Do I need to fix pathing to my version of Jekyll? Or is this some legacy part of pagination? It had been working fine until a few days ago, so also wondering if this is a system issue… for what it’s worth my Gemfile and full config below:

Gemfile

source "https://rubygems.org"
ruby RUBY_VERSION

gem "jekyll", "~> 3.0"
gem "minima", "~> 2.0"

source 'https://rubygems.org'

group :jekyll_plugins do
  gem "jekyll-paginate-v2", "~> 1.7"
  gem "jekyll-feed"
end

gem 'wdm', '>= 0.1.0' if Gem.win_platform?

Config.yml file

title: XXXXX
email: XXXXX@gmail.com
description: Daydreams of a sleepy carto fella.
baseurl: ""
url: "https://XXXXX.org"
github_username:  XXXXX

# Build settings
source: app
safe: false
timezone: America/New_York

markdown: kramdown
theme: minima
gems:
  - jekyll-paginate-v2
exclude:
  - README.md
  - bundle
  - Gemfile
  - Gemfile.lock

# Produces a cleaner folder structure when using categories
permalink: /:title/

# Pagination Settings
pagination:
  enabled: true
  per_page: 10
  permalink: '/page/:num/'
  title: ':title - page :num of :max'
  limit: 0
  sort_field: 'date'
  sort_reverse: true

Any help greatly appreciated!

Your error message itself is unrelated to paginate. Can you inform us what command you ran before the error and a longer log of errors?

Also check your PATH is set in your .zshrc or .zshrc in linux or mac, to include the ruby 2.3.0/bin directory.

Delete your cache folder and do a fresh install. You should be running Jekyll and paginate in side your project as vendor/bundle/ruby/…/jekyll. Not a bundler cache dir.

Make sure you run bundle config

bundle config set --local path vendor/bundle

And then bundle install.


Also your ruby and Jekyll versions can be updated. Ruby 2.6 or 2.7. And in your Gemfile use ~> 3.9 to match GH Pages.
Maybe update Bundle itself

Also make sure to change gems: in your config to plugins: as that is the new syntax.

Thanks for the thorough reply!

Here’s the full output:

bundler: failed to load command: jekyll (/Users/moriartyd/code/moriartynaps/bundle/cache/ruby/2.3.0/bin/jekyll)
LoadError: cannot load such file -- bundler
  /Users/moriartyd/code/moriartynaps/bundle/cache/ruby/2.3.0/gems/jekyll-3.4.3/lib/jekyll/plugin_manager.rb:34:in `require'
  /Users/moriartyd/code/moriartynaps/bundle/cache/ruby/2.3.0/gems/jekyll-3.4.3/lib/jekyll/plugin_manager.rb:34:in `require_from_bundler'
  /Users/moriartyd/code/moriartynaps/bundle/cache/ruby/2.3.0/gems/jekyll-3.4.3/exe/jekyll:9:in `<top (required)>'
  /Users/moriartyd/code/moriartynaps/bundle/cache/ruby/2.3.0/bin/jekyll:22:in `load'
  /Users/moriartyd/code/moriartynaps/bundle/cache/ruby/2.3.0/bin/jekyll:22:in `<top (required)>'

.zshrc file:


# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

I’ve done this, but still get the same error. Odd, given the path now should work – and does if I cd into that path.

Here’s the repo for further details: https://github.com/DylanMoriarty/moriartynaps/tree/develop

Your error says that Jekyll cannot find bundler.

So check or rerun the following.

Go to ~ or somewhere outside the project directory
Activate ruby environment e.g. ruby 2.3
Install bundler using rvm
Go to project folder. Run bundle config and install commands. To install jekyll and other gems
Run bundle exec jekyll serve

Also delete your bundle folder from version control.

Got it to work! From your suggestion of “install bundler using rvm”, found this page w/ this command:

gem install rubygems-bundler

Seems to work now with that. Thanks Michael!

1 Like

I don’t know why the rubygems- part. I normally do

gem install bundler

And, not using rvm, I also need --user-install