Jekyll:不允许操作@apply2files
Jekyll: Operation not permitted @ apply2files
我正在使用 Windows 10 的 Linux 子系统,我在其中安装了 Jekyll,但是当我 运行 bundle exec jekyll serve
它给了我:
jekyll 3.8.6 | Error: Operation not permitted @ apply2files - /mnt/e/Work/project/_site/images/banner.jpg
我知道 Windows 和 Linux 权限存在一些不兼容性,因为出于某种原因我的所有文件都归根用户所有,但是这个问题有解决办法吗?
我在这里 https://scottdorman.blog/2019/02/27/running-jekyll-on-wsl/ 找到了答案,作者说我必须关闭并重新打开 bash,但它不起作用。
这些“不允许操作”错误似乎与用户权利或所有权有关。
我在同事的 MAC 计算机上看到奇怪的错误。命令 ls -al
显示某些文件夹归 root 所有。
如果这适用于您,请尝试使用以下命令 change/transfer 将所有权授予您的用户:
sudo chmod -R 777 /mnt/e/Work/project/
sudo chown -R youruser /mnt/e/Work/project/
chmod和chown的区别很简单:
- chmod 改变模式
- chown 更改所有权
注意:这在 unixtutorial.org.
上有详细解释
对于 Windows Linux 子系统,我找到了这个 old blogpost devblogs.microsoft.com from January 2018:
How did permissions work in the past?
Prior to Build 17063, all files/folders list “root” as the owner and belonged to the group “root”. The permission bits on each file/folder was derived from Windows permissions–no write bit checked for Windows meant no write bit set in WSL.
Additionally, attempting to chmod or chown on a file/folder resulted in a no-op (they wouldn’t do anything!)
How do permissions work now?
For files that don’t have metadata, we apply the same approach as what is described in pre-17063 builds. But now, chmod/chown can assign metadata to the file or folder. Newly created files in WSL will be created with metadata by default and will respect the mount options you’ve set (discussed later) or the permissions you pass when executing a mkdir/open.
而且,我发现了这个 post:
chmod WSL (Bash) doesn't work,它表明卸载并重新安装驱动器足以使 chmod 和 chown 工作(在提到的 WSL 更新之后)。
正如@Mike Cole 在上面的评论中提到的那样:如果您使用的是 wsl,则可能会发生这种情况。我通过重新启动我的机器解决了这个问题,神奇的是它现在可以工作了。
我正在使用 Windows 10 的 Linux 子系统,我在其中安装了 Jekyll,但是当我 运行 bundle exec jekyll serve
它给了我:
jekyll 3.8.6 | Error: Operation not permitted @ apply2files - /mnt/e/Work/project/_site/images/banner.jpg
我知道 Windows 和 Linux 权限存在一些不兼容性,因为出于某种原因我的所有文件都归根用户所有,但是这个问题有解决办法吗?
我在这里 https://scottdorman.blog/2019/02/27/running-jekyll-on-wsl/ 找到了答案,作者说我必须关闭并重新打开 bash,但它不起作用。
这些“不允许操作”错误似乎与用户权利或所有权有关。
我在同事的 MAC 计算机上看到奇怪的错误。命令 ls -al
显示某些文件夹归 root 所有。
如果这适用于您,请尝试使用以下命令 change/transfer 将所有权授予您的用户:
sudo chmod -R 777 /mnt/e/Work/project/
sudo chown -R youruser /mnt/e/Work/project/
chmod和chown的区别很简单:
- chmod 改变模式
- chown 更改所有权
注意:这在 unixtutorial.org.
上有详细解释对于 Windows Linux 子系统,我找到了这个 old blogpost devblogs.microsoft.com from January 2018:
How did permissions work in the past?
Prior to Build 17063, all files/folders list “root” as the owner and belonged to the group “root”. The permission bits on each file/folder was derived from Windows permissions–no write bit checked for Windows meant no write bit set in WSL.
Additionally, attempting to chmod or chown on a file/folder resulted in a no-op (they wouldn’t do anything!)
How do permissions work now?
For files that don’t have metadata, we apply the same approach as what is described in pre-17063 builds. But now, chmod/chown can assign metadata to the file or folder. Newly created files in WSL will be created with metadata by default and will respect the mount options you’ve set (discussed later) or the permissions you pass when executing a mkdir/open.
而且,我发现了这个 post: chmod WSL (Bash) doesn't work,它表明卸载并重新安装驱动器足以使 chmod 和 chown 工作(在提到的 WSL 更新之后)。
正如@Mike Cole 在上面的评论中提到的那样:如果您使用的是 wsl,则可能会发生这种情况。我通过重新启动我的机器解决了这个问题,神奇的是它现在可以工作了。