由于权限错误,我无法构建使用 git 克隆的 jekyll 站点。我使用的是 Ubuntu 18.04。我已经查看了大多数有关此错误的帖子,但没有一个解决方案对我有用。
构建站点的命令是 docker-compose up。使用或不使用 sudo 运行此命令都不会更改错误。我在 docker 组中。我可以使用bundle exec jekyllserve 构建网站。此命令成功创建 _site 文件夹。
我尝试手动添加 _site,但这会导致不同的错误。
$ docker-compose up
Starting site ... done
Attaching to site
site | Configuration file: /srv/jekyll/_config.yml
site | Source: /srv/jekyll
site | Destination: /srv/jekyll/_site
site | Incremental build: disabled. Enable with --incremental
site | Generating...
site | Jekyll Feed: Generating feed for posts
site | jekyll 3.8.5 | Error: Permission denied @ dir_s_mkdir - /srv/jekyll/_site
site exited with code 1 …Run Code Online (Sandbox Code Playgroud)