授予路径许可 [英] Grant permission for the path

查看:39
本文介绍了授予路径许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在遵循此指南,以安装ruby,而除以下情况外,一切都没有问题:我尝试运行此命令

I am following this guide, to install ruby, while everything has no problem except when I try to run this command

发布新的myapp -d mysql

我收到此错误

  run  bundle install
There was an error while trying to write to
`/home/fil/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47`. It is likely that you need to
grant write permissions for that path.
         run  bundle exec spring binstub --all
bundler: command not found: spring
Install missing gem executables with `bundle install`

有什么办法解决这个问题?

Is there any way to solve this?

推荐答案

看起来您在某些时候以 root 身份运行了 bundle install(通过 sudo bundle install),您永远都不要这样做.您可以再次 sudo 来解决此问题,如@GurmukhSingh所建议的那样,但这只会使问题复杂化,从安全角度来看不是一个好主意.

It looks like you ran bundle install as root at some point (via sudo bundle install), which you should never do. You can sudo it again to get past this problem, as @GurmukhSingh suggests, but that's just going to compound the problem and isn't a good idea from a security standpoint.

如果要在Bundler缓存中查找不属于 fil 的文件(假设您的用户名为 fil ),则可以运行以下命令:

If you want to find files in your Bundler cache that aren't owned by fil (assuming your username is fil), you can run this:

find ~/.bundle/cache ! -user fil -ls

如果该命令返回任何内容,则可能是这些文件归 root (或其他用户)所有;找到-的 -ls 标志将显示谁拥有它们.

If that returns anything at all, then the problem is likely that those files are owned by root (or some other user); the -ls flag to find will show you who owns them.

您可以删除有问题的文件并再次运行 bundle install ,也可以使用以下命令更改其所有权:

You can delete the offending files and run bundle install again, or you can change the ownership of them with:

chown -R fil ~/.bundle/cache

您可能需要检查〜/.bundle 中的所有文件,而不仅是 cache 目录.

You may need to check on all files in ~/.bundle and not just the cache dir.

将来,请勿通过 sudo 运行捆绑安装.

这篇关于授予路径许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆