Jekyll takes several minutes to display help

I’m running Jekyll v4.2.1 on Ruby 2.7.5. Jekyll takes several minutes to do anything. Even running ‘bundle exec jekyll help’ takes several minutes. Anyone have any ideas of what could be causing this? No changes if I omit ‘bundle exec’.

Is your site quite large or do you have lots of plugins installed? If there’s a lot of content that could be why. What OS are you using?

Try running jekyll doctor (or bundle exec jekyll doctor) to see if there’s anything noticeably wrong with your repo.

At one point in time, I had some performance issues, so did the following steps (your experience may vary):

Backup your files if they aren’t in source control and then try deleting your gemfile.lock file. Next, run bundle install and bundle update. After that, see if you get any performance improvements.

If you’re site is in a public repo like GitHub or GitLab, could you share the link? I or someone else here could try rebuilding locally to see if we can provide more help.

Thanks for responding! My site seems rather small to me - just a handful of pages. I have run bundle install and bundle update recently. I’m not sure what ‘a lot’ of plugins is – I’m using a github pages template which uses these:

  • jekyll-archives
  • jekyll-email-protect
  • jekyll-feed
  • jekyll-github-metadata
  • jekyll-imagemagick
  • jekyll-paginate-v2
  • jekyll/scholar
  • jekyll-sitemap
  • jekyll-target-blank
  • jekyll-twitter-plugin
  • jemoji
  • jekyll-gist

jekyll doctor fixed another, more serious problem for me – so thanks for that! But it is still very slow. If anyone wants to look at my page here is the source branch on github: GitHub - mrpeverill/mrpeverill.github.io at source .

For reference: building your site’s source branch takes a handful of seconds on a laptop from a few years ago, so the slow build your seeing is definitely odd.

To test if it is a general Ruby problem, you could try running jekyll outside of the build folder (where there’s no Gemfile), for example in /tmp:

$ cd /tmp

$ time jekyll -v
jekyll 4.2.1
jekyll -v  1.21s user 0.97s system 98% cpu 2.211 total

$ time jekyll help
[...]
jekyll help  2.06s user 1.33s system 97% cpu 3.475 total

I can take a look tomorrow to see if I see anything. The plug-in list does not look bad. I do see you have imagemagick installed. Are you doing any graphics processing with it? If so, I’ve experienced slower build times with that.

Thank you! I’m not seeing a huge delay when I run those commands in my home directory:

Matt Peverill@mattpeverill MINGW64 ~
$ time jekyll -v
jekyll 4.2.1

real    0m3.394s
user    0m0.000s
sys     0m0.031s

And:

Matt Peverill@mattpeverill MINGW64 ~
$ time jekyll help
jekyll 4.2.1 -- Jekyll is a blog-aware, static site generator in Ruby
[...]
real    0m5.135s
user    0m0.015s
sys     0m0.062s

In my project directory, however:

Matt Peverill@mattpeverill MINGW64 ~/Dropbox/mrpeverill-website (source)
$ time jekyll help
Resolving dependencies...
jekyll 4.2.1 -- Jekyll is a blog-aware, static site generator in Ruby
[...]
real    3m52.756s
user    0m0.000s
sys     0m0.061s

So maybe the delay is coming from some part of dependency resolution?

I’m not using it (yet), but if I comment it out of Gemfile and _config.yml I don’t see much improvement.

@mrpeverill I downloaded the zip from your source folder using the GH web UI, did a bundle install and a bundle update, both of which ran successfully. I then ran bundle exec jekyll serve --livereload and it successfully ran in .48 seconds.

Next, I cloned your repo locally, went to the source branch, and performed the same steps and the site build was completed in .97 seconds.

Finally, I cloned your repo, went to the source branch and without doing anything else, I typed bundle exec jekyll serve --livereload and that took .904 seconds to run.

At this point, I am not sure what to think, so I will throw some ideas up against the wall and see what sticks :slight_smile:

  • Run bundle exec jekyll serve --livereload --verbose. Do you see any place where it hangs out? That might help you identify where the hangup is.
  • Maybe this has to do with the folder you are working in? Try cloning your repo to another folder and building from there. Do you get the same results?
  • Maybe your local branch has a significant number of uncommitted files? Try committing them to clean things up (again shouldn’t matter, but just a thought)
  • Type bundle exec jekyll --version and see if it says jekyll 4.2.1, just to be sure you do not have a mismatched version
  • In an earlier conversation, I suggested you delete the Gemfile.lock file and do a new bundle install and bundle update. You said you recently did an install and update, but I do not know if you tried deleting the gemfile.lock file. Maybe see if that helps if you did not perform the step last time?

I hope at least one of these ideas helps!

To rule dependency out of the checklist, install gem bundler and prepend bundle exec to Jekyll command:

$ gem install bundler
$ time bundle exec jekyll help

In theory, this should bring the time taken closer to the result from your home directory but YMMV.

Thanks for your persistence! Let me follow up on your points in order:

  • I am running on Windows x64. I am running all commands in git bash. I also tried bundle exec jekyll help in a regular cmd window but that didn’t change anything.
  • I do not have any uncommitted files in the directory.
  • bundle exec jekyll --version says jekyll 4.2.1 .
  • I re-tried rm Gemfile.lock, bundle install, and bundle update but there was no change.
  • When I run bundle exec jekyll serve --livereload --verbose it waits at the command line for a few minutes, then rapidly spits out a bunch of debug information. So it seems to be that the delay starts before jekyll starts doing any work on the page (which also makes sense since the delay happens even with jekyll help).
  • I tried cloning to another directory, running install and update, then time bundle exec jekyll help and it comes in at > 2 minutes.

Sorry it’s a stumper!

Can you do the verbose command again and then copy and paste the entire output here (make sure you paste it as code)? Please also point out exactly where it is sitting and waiting before the rest of the command runs.

Have you tried cleaning the cache?

bundle exec jekyll clean

then build it again:

bundle exec jekyll build

I cloned your repo and it took 2.25 seconds to me.

I was having the exact same problem as @mrpeverill. I was also trying to create a static site from a fork of the al-folio template.

The culprit for me was the ‘unicode_utils’ gem. I removed this from my Gemfile and then the jekyll help command went from 3min 50s down to about a second. I’m not sure the effects of removing this gem on the al-folio template, but I was able to serve the website locally in around 2 seconds on an old laptop.

Not sure why this behavior happens as I am a jekyll novice. For reference, I was running windows 11 and the jekyll commands in git bash.

I had the same problem. I don’t have ruby installed on my system, so I used the docker.io /jekyll/builder:latest image to run jekyll. Initially, I ran the jekyll serve command with the --livereload flag. Server content delivery was reallly slow … minutes. After some trial and error, I dropped the --livereload flag and that resolved it. I found that --watch is the right flag for live reloading

For those wanting to use a docker image, theses are the commands I found useful =>

  1. run the container in the background =>
docker run -d -t --rm --name jekyll-1 -v $PWD/src:/srv/jekyll:Z -p 4000:4000 jekyll/builder sh -l
  1. Exec into the container =>
docker exec -it jekyll-1 sh -l

Inside the container, here are some useful commands =>

  1. For installing new gems =>
    bundle install
  2. Build the jekyll datafeed
    bundle exec jekyll build
  3. Run jekyll
    jekyll serve --watch
  4. clean jekyll-cache if needed
    bundle exec jekyll clean

Solution in my case: Don’t use Jekyll in VM, with gems on a mounted drive.

I was learning Jekyll, by using a Ubuntu 22.04 VM inside Windows 10 WSL 2.0. The location of my experiments were inside C:\Users\Velle\coding, mounted on Ubuntu at ~/coding. I set up bundle to save the gems in there as well (~/coding/test1/gems).

It took 50-60 seconds just to run “bundle exec jekyll help”, but less than 1 second if I used the global gems.

$ time bundle exec jekyll --help > /dev/null
real    0m56.119s
user    0m0.963s
sys     0m13.201s
$ time jekyll --help > /dev/null
real    0m3.408s
user    0m0.752s
sys     0m0.676s

Its not the first time I do programming with this exact setup (working on native mounted folder in WSL), and I have noticed in the past that some operations, such as “git status” are slow, when working inside this mounted folder. But it’s the first time anything was so slow, that I thought it was hanging/broken.