나는 요리사에게 제공하는 것을 삼가하고 있습니다. root 사용자와 다른 사용자의 'deploy'에 대해 루비와 루비 젬이 필요합니다.요리사의 보석 명령에 sudo를 사용하는 방법
루비와 루비 젬이 설치되어 있고 루트 사용자 (테스트 케이스 "방랑제")에서 작동합니다.
나는
user 'deploy' do
password '$1$zOC.txvE$ex544C.YpxV.HqNh/2AKQ0'
home "/home/deploy"
supports :manage_home => true
shell "/bin/bash"
end
가 그럼 난이 '배포'사용자
execute 'change sources to our gem server' do
command "gem sources -r http://rubygems.org/ && gem sources -a http://my.gem.server/"
creates "~/.gemrc"
user 'deploy'
cwd "/home/deploy"
end
에 대한 보석 소스를 변경할 수 있지만,이 오류를 얻을려고 내 응용 프로그램 배포하기 위해 카피 스트라 노에 후 사용하기위한 하나의 사용자를 생성
[2014-02-14T14:38:27+00:00] ERROR: execute[change sources to our gem server] (beesor-cookbook::user line 13) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of gem sources -r http://rubygems.org/ && gem sources -a http://my.gem.server/ ----
STDOUT: source http://rubygems.org/ not present in cache
STDERR: ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /home/vagrant/.gemrc
---- End output of gem sources -r http://rubygems.org/ && gem sources -a http://my.gem.server/ ----
Ran gem sources -r http://rubygems.org/ && gem sources -a http://my.gem.server/ returned 1
나는 사용자가 실제로 CHEF-으로 실행되는 생각 때문에 /home/deploy/.gemrc하지 2288 (예 : ENV [ 'HOME']이 잘못되었습니다.)하지만 실행 리소스를 템플릿 리소스로 바꾸는 솔루션으로 문제가 해결됩니다. – lamont