2012-12-25 2 views
10

gitlab을 설치하려고하므로 sudo, 을 사용하는 다른 사용자 계정에서 보석을 설치하려고합니다.하지만 계속해서 Permission denied 오류가 발생합니다.Errno :: EACCES : 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 
+0

당신이 봤어 명령을 실행하는 사용자가 소유 - gitlab' 해당 사용자로 로그인 한 다음 명령을 실행하고 작업이 완료 로그 아웃있을 때하는 ? 더 쉬울 수도 있습니다. – iain

+0

예. 나는 그랬다. 같은 결과 ('Errno :: EACCES : Permission denied - pygments.rb-0.3.2.gem') – Alex

+1

bin과 gem 디렉토리에 프로젝트 로컬 디렉토리를 사용할 수 있습니다. 나는 지금 모든 나의 프로젝트에서 그것을한다. 'cd/home/gitlab/gitlab' 그리고 나서'bundle install -binstubs --path vendor' (gitlab처럼) 그리고 모든 젬은 ./vendor에 들어가고 모든 exe는 프로젝트 루트에 상대적인 ./bin 안에 있습니다. – iain

답변

13

번들을 다른 하위 디렉토리에 설치하려고 시도하는 것이 좋습니다. 문제가 해결되면 현재 디렉토리의 권한에 대한 문제가 발생했습니다.

chown -R gitlab:gitlab .을 실행하면이 문제가 해결되었습니다.

gitlab 설치 안내서에는 gem install 명령이 루트 이전에 실행되었고 아마도 gemfile 또는 다른 파일에 권한이 변경되어있을 수 있습니다.

+3

변경 내용을 실제로 알지 못하면 모든 디렉터리와 하위 디렉터리의 모든 사용 권한이나 소유자를 변경하지 마십시오. – Tecnocat

8

이 번들 루비 2.0.0-p195의 RVM의 권한 버그는 RVM을 사용하는

설치한다? sudo로 chmod를 시도 했습니까?

chmod 755 (or 777) ~/.rvm/gems/ruby-2.0.0-p195/build_info/

0

확인하여 Gemfile.lock 단지`스와

관련 문제