首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gitlab资产:预编译RAILS_ENV=production失败并出现权限错误

gitlab资产:预编译RAILS_ENV=production失败并出现权限错误
EN

Stack Overflow用户
提问于 2015-02-27 08:53:23
回答 3查看 2.6K关注 0票数 3

我在GitLab 7上安装了CentOS 7.7.2并成功安装。

现在,我尝试以子目录样式(如GitLab )运行http://url/gitlab

我查看了这个文件,并根据这个指令进行了修改。/opt/gitlab/embedded/service/gitlab-rails/config

然后我预编了程序,得到了错误。

代码语言:javascript
复制
# gitlab-rake assets:precompile RAILS_ENV=production
I, [2015-02-27T17:35:18.980208 #4864]  INFO -- : Writing /opt/gitlab/embedded/service/gitlab-rails/public/assets/authbuttons/github_32-199ebcd7adccbfe20068d39bfd57e6bf.png
rake aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /opt/gitlab/embedded/service/gitlab-rails/public/assets/authbuttons/github_32-199ebcd7adccbfe20068d39bfd57e6bf.png+

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

我该怎么办?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2015-02-28 09:52:28

首先,直接更改文件将导致在reconfigure之后重写它们。在调用gitlab-rake时,您不必声明由gitlab-rake包装器处理的RAILS_ENV

现在,就相对url选项而言,这还没有在总括包中实现。

票数 1
EN

Stack Overflow用户

发布于 2015-10-09 13:14:34

这个职位描述了一个很好的解决方法。类似于用户建议,我们可以暂时打开编译新资产和更改资产的权限,然后再次关闭它们。

通过使用ACLs,而不是标准位,这只对git用户进行,而不实际更改root:root的所有权。

代码语言:javascript
复制
# ... hack on CSS ...

# Need to let user `git` write to assets/ because gitlab-rake tries to write
# to it as `git`, while `assets/` is owned by root.
apt-get install acl
setfacl -R -m u:git:rwX /opt/gitlab/embedded/service/gitlab-rails/public/assets/
gitlab-rake assets:precompile RAILS_ENV=production
chmod -R a+rX /opt/gitlab/embedded/service/gitlab-rails/public/assets/

# Remove git's write access
setfacl -R -x u:git /opt

这既适用于添加新映像,也适用于更改现有资产。

票数 6
EN

Stack Overflow用户

发布于 2015-02-28 20:54:55

chmod -R 1777 /opt/gitlab/embedded/service/gitlab-rails/public/assets为我做了这个把戏。

它为每个人设置完整读/写/执行的权限,并在't‘上设置粘性位(除了root/文件所有者之外,没有人可以删除目录,从而允许rake完成它的操作)。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28760917

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档