为什么我没有获得 Gem 的文件权限,如何解决?

问题描述 投票:0回答:1

当我尝试使用命令 gem pristine ffi --version 1.16.3 恢复 Gem pristine 时,出现以下权限错误。有什么解决方法吗?我最终正在尝试安装 cocoapods。

Restoring gems to pristine condition...
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the 
    /Users/XXDFDFGDFGDFGXX/.rubies/ruby-3.3.1/lib/ruby/gems/3.3.0/gems/ffi-1.16.3/CHANGELOG.md
    directory.
ruby flutter rubygems cocoapods
1个回答
0
投票

您的

.rubies
文件夹中的文件权限有问题。您可以尝试恢复权限,然后重试。

# Restore ownership of everything using sudo
sudo chown -R your_username:your_username /Users/your_username/.rubies

# Set read and write permissions for your user recursively
chmod -R u+rw /Users/your_username/.rubies

请注意,这些是递归命令,因此请确保正确输入路径。

© www.soinside.com 2019 - 2024. All rights reserved.