程序员

ERROR: While executing gem ... (

2022-07-22  本文已影响0人  心猿意码_
$ gem install jekyll bundler
$ jekyll new myblog
ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write 
permissions for the /Library/[Ruby](https://so.csdn.net/so/search?
q=Ruby&spm=1001.2101.3001.7020)/Gems/2.6.0 directory

分析报错:我们在使用gem进行安装的时候,发现没有权限可以在路径 /Library/Ruby/Gems/2.6.0下进行写操作

解决方法:
// username是用户名(如上图中终端中显示:root 位置的名字)
sudo chown -R username /Library/Ruby/Gems/2.6.0

其中,将username替换为当前用户的用户名即可

$ gem install jekyll bundler
$ jekyll new myblog

注意:后面再次提示读写权限问题,按sudo chown -R username /Library/Ruby/Gems/2.6.0 的拼接方式,在终端执行就好。

上一篇 下一篇

猜你喜欢

热点阅读