Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在MacOS终端中运行捆绑包安装时出现问题_Ruby On Rails_Rubygems - Fatal编程技术网

Ruby on rails 在MacOS终端中运行捆绑包安装时出现问题

Ruby on rails 在MacOS终端中运行捆绑包安装时出现问题,ruby-on-rails,rubygems,Ruby On Rails,Rubygems,运行bundle install时,我收到错误消息 There was an error while trying to write to '/Users/my-user/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions'. It is likely that you need to grant write permissions for that path. 我使用的是

运行
bundle install
时,我收到错误消息

There was an error while trying to write to
'/Users/my-user/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions'.
It is likely that you need to grant write permissions for that path.
我使用的是Ruby 2.3.3版,使用的平台是x86\u 64-darwin18。 他们对如何修复这个错误有什么建议吗

我已经尝试解锁该文件,但它说该文件无法解锁,只能为我提供制作副本的机会。

你能试试吗

1)
chown-R USERNAME/Users/my user/.bundle/cache/compact\u index/

2)
sudo捆绑包安装

3)
bundle exec bundle安装

4) 只需授予chown-R USERNAME/Users/my user/.bundle/cache/

5)
rm-rf/Users/my user/.bundle/cache


将用户名替换为系统用户名

在运行该命令,然后再次尝试进行
捆绑安装
后,我得到了相同的结果error@peopleplusme请尝试
sudo bundle安装
bundle exec bundle安装
,好吗,否则只需授予
chown-R USERNAME/Users/my user/.bundle/cache/
rm-rf/Users/my user/.bundle/cache/