Regeneration loop Mac OS

Help! I have been using Jekyll for years successfully, but I am not a savvy programmer. I’ve just been lucky, I think. I am using 4.2 on Big Sur 11.6, and have recently tried to work with Git, but my sites are all made on my local machine and uploaded manually to a commercial server.

When I run “jekyll-serve” on my machine, it starts to cache and regenerate endlessly … this can’t be correct. Is it something in the config file? Does it have anything to do with Git?

Can anyone help me figure this out?

edited to add: I think the problem might be in my $PATH. I am using zshell, and the system Ruby, even though I’ve installed the newest Ruby with Homebrew. If so, how do I fix the PATH, if this makes sense. Thanks, again.

what is in your config file? jekyll should not be running in a loop.

I could almost see how if you somehow are not ignoring git or somehow have it watching the _site folder, a change to the site folder could maybe cause a change in the .git folder and if jekyll was watching that for some reason it would regenerate and so on.

If you look in the _site folder is there a .git folder? there should not be.

Not sure where the path would come in to play here, it sounds like jekyll is working. What happens if you just do jekyll build? does it run without errors?

Jekyll’s regeneration doesn’t have anything to do with Git.
The only location Jekyll’s regenerator watches is the source directory.

Therefore, pay attention to the messages printed on the terminal.
Ideally, Jekyll wouldn’t regenerate when .jekyll-cache at source directory gets created / modified.

However, if you have multiple servers running (for the same source directory but mounted to different host:port combo), there’s a chance that one of the server regenerating because of another server modifying the source directory.

Ensure that no other running processes is modifying the source directory and then restart Jekyll’s server.

1 Like

Thank you for these clues. Glad I can not worry about Git being the cause of it. I think the problem is with the path to the latest Ruby, which I’ve installed via Homebrew and asdf. I think I might have missed some steps there, so I’m researching that.

Jekyll is still looping frantically, for both the cache as well as running through every file in the site, over and over. Nonetheless, it still builds the site perfectly, with no errors.

Might the problem be with the old version of Ruby, which Mac OS wants left alone? Thank you again for helping with this very frustrating problem.

Try run with --verbose which is noisy but will tell you perhaps what file is being edited to cause the reload.

To rule out Ruby installation as the cause, create a new Jekyll workspace outside your current source directory by running:

jekyll new <SOME PATH>

Serve the newly created workspace.
If that loops as well, it could be your Ruby set up. Either ways, continue reading below…

To rule out caching as the cause, you may use the --disable-disk-cache flag when invoking the server.

bundle exec jekyll serve --disable-disk-cache

If the loop breaks, restart the server without the disable flag. If the loop resurfaces on serving without the flag, stop the server, delete the cache directory and restart server.

Solved. You’re not going to believe what seems to have caused the problem and what seems to be the solution. It’s icons. Icons in the title of the sourse directory seems to set Jekyll into the endless looping.

When I tried making a new site, there was no problem. In fact, one of my five current sites was also not looping, and I wondered why. Configs were the same, etc., but that one site didn’t have an icon in the title. So, I removed the icons from the all my sites giving me the problem, and they are all working fine.

So, my sites will be losing icons like :alien:, but not in the individual page titles – just in the main site title. Hope this can help someone else. :slight_smile:

2 Likes

Great you found this, congrats! It might be a question of allowed character set for variables, here a general unicode problem. Good to know.

That’s awesome!
Glad you resolved the issue.

I for one would not have thought of an icon or unicode symbols in the directory name.