Jekyll snap : Help needed - Write permissions issue

Hi, I am new to snapcraft.
I have been trying to build the snap for jekyll.

The snap is working with all commands except with the use of bundler.
That is when I create a new blog :
For eg. : jekyll-jl new testblog

I get the following error :

Bundler: Errno::EROFS: Read-only file system @ rb_sysopen - /snap/jekyll-jl/x1/lib/ruby/gems/2.4.0/bundler.lock

I cannot get bundler to have the write permissions.
What am I doing wrong ?

Here’s my snapcraft.yaml file : Snapcraft.yaml file

Ignore the name right now.
I’ll ask for the jekyll alias later.

Complete error backtrace : jekyll bundler issue

@elopio - Can you help me regarding this ?

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.

1 Like