Tôi đang cố cài đặt gitlab và do đó cài đặt một số đá quý từ tài khoản người dùng khác bằng sudo, nhưng tôi liên tục gặp lỗi Permission denied
.Errno :: EACCES: Quyền bị từ chối khi cài đặt đá quý qua gitlab
sudo -u gitlab -H bundle install --deployment --without development test postgres
> Using ... (a lot of successful gems there)
> Using pygments.rb (0.3.2) from https://github.com/gitlabhq/pygments.rb.git (at master)
> Errno::EACCES: Permission denied - pygments.rb-0.3.2.gem
> An error occurred while installing pygments.rb (0.3.2), and Bundler cannot continue.
> Make sure that `gem install pygments.rb -v '0.3.2'` succeeds before bundling.\
sudo -u gitlab -H gem install pygments.rb -v '0.3.2'
> Successfully installed pygments.rb-0.3.2
> 1 gem installed
> Installing ri documentation for pygments.rb-0.3.2...
> Installing RDoc documentation for pygments.rb-0.3.2...
# no matter how many times I run this command, I always get the same output
# as if the gem installation doesn't stick
# I've tried to chmod
chmod 777 -R /usr/local/lib/ruby
# then Again
sudo -u gitlab -H bundle install --deployment --without development test postgres
# same result, Errno::EACCES: Permission denied - pygments.rb-0.3.2.gem
Bạn đã cố gắng chỉ là 'su - gitlab' để đăng nhập như người dùng và sau đó chạy các lệnh và khi bạn đã hoàn tất logout ? Nó có thể dễ dàng hơn. – iain
Đúng. Tôi đã làm. Cùng một kết quả ('Errno :: EACCES: Quyền bị từ chối - pygments.rb-0.3.2.gem') – Alex
Bạn có thể thử sử dụng dự án địa phương dirs cho bin và gem dirs. Tôi làm điều đó trên tất cả các dự án của tôi ngay bây giờ ví dụ: 'cd/home/gitlab/gitlab' sau đó' bundle install --binstubs --path vendor' (như gitlab) và tất cả các gem đi vào ./vendor và tất cả các exe trong ./bin, liên quan đến gốc của dự án. – iain