【问题标题】:Why the cargo run command throws me OS Error 13 on Linux?为什么 cargo run 命令会在 Linux 上向我抛出 OS Error 13?
【发布时间】:2023-04-10 23:05:01
【问题描述】:

我在Arch Linux 的外部NTFS 分区中创建了一个带有cargoRust 项目。 当我运行cargo build 时,该命令有效,但如果我运行cargo run 命令,cargo 会抛出以下错误:

[myuser@myuser myproject]$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/myproject`
error: could not execute process `target/debug/myproject` (never executed)

Caused by:
  Permission denied (os error 13)

我认为错误可能是由于分区的权限引起的。这是我在/etc/fstab 中的安装配置:

UUID=XXXXXXX                   /path/to/mountpoint ntfs-3g         defaults,nls=utf8,umask=000,dmask=027,fmask=137,uid=1000,gid=1000,windows_names         0 0

可以找到类似的错误here

这个问题的原因可能是什么?

谢谢。

【问题讨论】:

    标签: rust archlinux partition rust-cargo


    【解决方案1】:

    NTFS 不支持 Linux 权限,因此无法执行存储在 NTFS 上的文件。将您的项目保存在专为 Linux 设计的文件系统上,例如 ext4,以解决此问题。

    【讨论】:

      【解决方案2】:

      如果您按照here 中提到的步骤操作,可以将 NTFS 配置为允许软件执行。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-03-25
        • 2019-11-18
        • 1970-01-01
        • 2013-08-10
        • 1970-01-01
        • 1970-01-01
        • 2021-07-29
        • 1970-01-01
        相关资源
        最近更新 更多