gpt4 book ai didi

gitlab-rake Assets :precompile RAILS_ENV=production fails with Permission error

转载 作者:行者123 更新时间:2023-12-01 23:35:14 28 4
gpt4 key购买 nike

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

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

我查看了这个文件并按照这个指令进行了更改。/opt/gitlab/embedded/service/gitlab-rails/config

然后我预编译并出现错误。

# 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)

我应该做什么?

最佳答案

This post描述了一个很好的解决方法。类似于user Perceval FARAMAZ suggests我们可以暂时打开编译新资源和更改资源的权限,然后再次关闭它们。

通过使用 ACL,而不是标准位,这仅针对 git 用户完成,而无需实际更改 root:root 的所有权:

# ... 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

这适用于添加新图像以及更改现有资源。

关于gitlab-rake Assets :precompile RAILS_ENV=production fails with Permission error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28760917/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com