# Jekyll serve auto-regeneration not recognizing changes after Gemfile update

**URL:** <https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335>\
**Category:** Uncategorized\
**Created:** [December 8, 2020, 3:47pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335 "2020-12-08T15:47:22Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jglovier](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jglovier/32/3014_2.png) [@jglovier](https://talk.jekyllrb.com/u/jglovier)\
**Post date:** [December 8, 2020, 3:47pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/1 "2020-12-08T15:47:22Z")

</div>

I was working on my Jekyll site recently and all was working as expected in my setup. When I was finished with my work, I [bumped the Gemfile.lock to fix a security vulnerability](https://github.com/jglovier/jglovier.github.io/commit/340748432e7a1a661fdd0bf44758e7d551d0cf2b) (thanks GitHub security notifications! 🙌) with a version of Kramdown. After the Gemfile bump, however, my Jekyll setup stopped working correctly.

Now, whenever I make changes to the code while `bundle exec jekyll serve` is running, the auto-generation doesn’t appear to be working (i.e. no changes occur in my browser, and yes I’ve verified that I’m working at localhost:4000 😅).

If I restart my server, after the restart the changes show up in my browser (so I know the initial jekyll build is working to recognize my changes), but any subsequent changes once server is running again are not recognized.

Looking at the server output I see that incremental build is disabled, and I can also verify that Auto-generation is enabled according to the server output.

Strangely, something that is new in the output since this has started occurring is all this output with `block in _process_changes`, `block in new`, etc:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/c/cefec1c6097b052a61d87671f6dfcee7d3e37d7a.png)

I don’t recall seeing that prior to this issue and prior to my Gemfile bump.

I’ve tried running with `--watch`, `--incremental`, and `--force_polling`, but neither of those fix the issue.

I suspect this has to do with either the github-pages or jekyll gem bump, but I really don’t know. Any suggestions for what to try next?

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 8, 2020, 4:43pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/2 "2020-12-08T16:43:45Z")

</div>

Comparing your `Gemfile.lock` to a freshly installed one for Github-Pages, I see various differences (ActiveSupport 5 vs 6, Github-Pages 207 vs 209, etc). Maybe rebuilding the lock file completely would help? (i.e. delete `Gemfile.lock` and run `bundle install`).

For my Github-Pages based sites, I don’t commit the lock file because the gems used by Github-Pages are not fixed and so local gems need regular updating to stay in sync.

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 8, 2020, 5:16pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/3 "2020-12-08T17:16:49Z")

</div>

Hello Joel,  
Could you update your Gemfile to lock gem `listen` to just `v3.2.1` and try again?

```ruby
# Gemfile

gem "listen", "~> 3.2.1"

```

_Bundler will prompt you to run `bundle update` when you try running `bundle exec jekyll serve`…_

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 8, 2020, 8:25pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/4 "2020-12-08T20:25:01Z")

</div>

From the screenshot, it looks like Ruby 2.3 is being used (`../rbenv/versions/2.3.3/...`). In theory, Jekyll 3.x should work with that version, but Ruby dropped support for 2.3 in 2019 and Github-Pages isn’t being tested with anything earlier than 2.5.

Possibly upgrading Ruby to 2.5 or higher would help?

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 8, 2020, 9:24pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/5 "2020-12-08T21:24:33Z")

</div>

I tried building your site under Ruby 2.3 (Docker) and I can produce a nearly-identical error when the `_includes` directory (not contents) is modified. I.e. `touch _includes/`causes a `scan DIED` error and after that Jekyll-serve hangs.

Using Ruby 2.7, rebuilding works as expected.

---

<div class="post-metadata">

**Author:** ![jglovier](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jglovier/32/3014_2.png) [@jglovier](https://talk.jekyllrb.com/u/jglovier)\
**Post date:** [December 9, 2020, 4:06pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/6 "2020-12-09T16:06:33Z")

</div>

@ashmaroli thanks, pinning Listen ver seems to have resolved the issue. 🙌

@chuckhoupt thanks, I upgraded my local Ruby ver to 2.7 just to be safe. 😊 👍

> For my Github-Pages based sites, I don’t commit the lock file because the gems used by Github-Pages are not fixed and so local gems need regular updating to stay in sync.

Now that I think about it, I’m not sure if I need the github pages gem anymore since my site is no longer hosted on GH Pages, but is on Netlify. Would I be safe to just remove the github-pages gem?

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 9, 2020, 6:14pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/7 "2020-12-09T18:14:57Z")

</div>

> [@jglovier](#):
>
> Would I be safe to just remove the github-pages gem?

Technically, one would only need the `github-pages` gem only if they’re deploying via GitHub Pages. So it is safe to remove.  
However, do note that since the GP gem has many `runtime_dependencies`, they automatically get included in the bundle and if used under the `jekyll_plugins` group in the Gemfile, the dependencies get loaded automatically during a `jekyll build` as well.

So, if you can be certain that all plugins needed for your site are explicitly listed in **both the Gemfile and the config file** , removing the GP gem is absolutely safe.

---

<div class="post-metadata">

**Author:** ![jglovier](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jglovier/32/3014_2.png) [@jglovier](https://talk.jekyllrb.com/u/jglovier)\
**Post date:** [December 9, 2020, 11:35pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/8 "2020-12-09T23:35:00Z")

</div>

> [@ashmaroli](#):
>
> So, if you can be certain that all plugins needed for your site are explicitly listed in **both the Gemfile and the config file** , removing the GP gem is absolutely safe.

Thanks for the clarification. Just to be safe I guess I’ll keep it around! 😊

---

<div class="post-metadata">

**Author:** ![jglovier](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jglovier/32/3014_2.png) [@jglovier](https://talk.jekyllrb.com/u/jglovier)\
**Post date:** [December 9, 2020, 11:35pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/9 "2020-12-09T23:35:56Z")

</div>

I think all is well now. Thank you so much for help, @ashmaroli and @chuckhoupt!!! 🙇‍♂️ 💛 🙌

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 10, 2020, 10:35am UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/10 "2020-12-10T10:35:09Z")

</div>

A downside to using the GHP gem when not actually deploying via GHP is that one is limited to just one version of Jekyll (i.e. can’t use Jekyll 4.x)

---

<div class="post-metadata">

**Author:** ![roadie](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/roadie/32/2431_2.png) [@roadie](https://talk.jekyllrb.com/u/roadie)\
**Post date:** [December 11, 2020, 10:42am UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/11 "2020-12-11T10:42:12Z")

</div>

The only gem I have is Jekyll I think but its also in local/bin as a standalone. I don’t have a gemfile in any of my jekyll site roots either. Does Jekyll need gems?

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 11, 2020, 1:08pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/12 "2020-12-11T13:08:52Z")

</div>

Jekyll runs fine as a stand-alone, global Gem, but it limits you to using a single version\* of Jekyll and related gems (plugins, themes, etc). If you have multiple sites that require different versions of Jekyll (and related gems), then using Bundler can save you from manually juggling global Gems (i.e. “gem version hell”).

For example, until recently I had sites that required Jekyll 3.1, 3.9, and 4.1. Using Bundler’s Gemfile/Gemfile.lock mechanism was the only sane way to work with them. As soon as you have two or more sites of different ages (i.e. with incompatible gems), Bundler becomes a necessity.

\* _Different global Gems can be accessed by version number, but it is awkward. e.g. `jekyll _3.9.0_ build`_

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [December 12, 2020, 6:56am UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/13 "2020-12-12T06:56:30Z")

</div>

> [@roadie](#):
>
> The only gem I have is Jekyll I think…

If you absolutely have only one gem, (i.e. `jekyll`), then you will have trouble.  
The following link is the Rubygem page for Jekyll:  
[https://rubygems.org/gems/jekyll](https://rubygems.org/gems/jekyll)  
The list of 14 gems under the heading `RUNTIME DEPENDENCIES` has to be present in your system for Jekyll to run all aspects of itself.  
Therefore, when an end-user runs `gem install jekyll` (the recommended way to install `jekyll` without using a Gemfile), Ruby downloads those 14 gems and installs them along with the `jekyll` gem.  
Similarly, if any of those 14 gems have `runtime_dependencies` of their own, then those gems too shall be downloaded and installed.  
So on and so forth.

---

<div class="post-metadata">

**Author:** ![roadie](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/roadie/32/2431_2.png) [@roadie](https://talk.jekyllrb.com/u/roadie)\
**Post date:** [December 12, 2020, 3:47pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-auto-regeneration-not-recognizing-changes-after-gemfile-update/5335/14 "2020-12-12T15:47:32Z")

</div>

oh right - forgot. I have those dependencies of course. I don’t use sass or the jekyll watch but they are there. I just never see them or get any nudges to update anything.
