You need to set the environment variables indicating the Gem Home and Gem Path.
Specifically, you will want to set GEM_HOME to a single writable path and then add that path as an extra entry into GEM_PATH. Currently you are using $SNAP which is a readonly filesystem. Confined snap packages have a writable filesystem at either $SNAP_USER_DATA or $SNAP_USER_COMMON. For things that will likely be incompatible between different Jekyll versions you should use the former, because that will copy the data when a new release is installed and allow you to rollback/revert to the previous version including the data so that you don’t end up with an old version with newer incompatible data.