您没有写入/var/lib/gems/1.9.1目录的权限 [英] You don't have write permissions into the /var/lib/gems/1.9.1 directory
问题描述
错误:执行gem时...(Gem: :FilePermissionError)
您没有写入 /var/lib/gems/1.9.1 目录的权限。
obs。我在Ubuntu 14上运行。
根据这个问题,我看到几个步骤以允许写入 / var / lib / gems
:
-
创建
gems
(如果没有的话)组,然后将自己添加到组中:
$ groupadd -f宝石
$ usermod -aG gems $(whoami)
-
重新进入会话:
$ sudo -u $(whoami)bash
-
允许将
gems
组写入/ var / lib / gems /
,并设置setgid
位:
$ chown:gems / var / lib / gems /
$ chmod g + sw / var / lib / gems /
-
尝试将宝石安装到
/ var / lib / gems /
。
注意:我强烈建议您通过 rbenv / rvm 将它们保存在本地主文件夹中。请参阅答案,以了解如何正确设置您的项目。
I got this error, for all gem that I try to install:
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /var/lib/gems/1.9.1 directory.
obs. I'm running on Ubuntu 14.
According the question I see a few steps in order to allow writing to /var/lib/gems
:
Create
gems
(if not any) group, and add yourself to the group:$ groupadd -f gems $ usermod -aG gems $(whoami)
When reenter to the session:
$ sudo -u $(whoami) bash
Allow write for a
gems
group to/var/lib/gems/
, and set thesetgid
bits:$ chown :gems /var/lib/gems/ $ chmod g+sw /var/lib/gems/
Try installing gems into
/var/lib/gems/
.
NOTE: I strongly advice you to control rubies and gems via rbenv/rvm keeping them in a local home folder. Please refer to the answer to know how to properly setup your project.
这篇关于您没有写入/var/lib/gems/1.9.1目录的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!