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?
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 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
$ 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
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
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)
bundle exec jekyll --versionand 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.lockfile and do a new
bundle update. You said you recently did an install and update, but I do not know if you tried deleting the
gemfile.lockfile. 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 helpin 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
bundle install, and
bundle updatebut there was no change.
- When I run
bundle exec jekyll serve --livereload --verboseit 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 helpand 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.