요리사에서 요리법을 쓰려고하는데 리눅스에서 명령 행으로 멀티 라인을 실행할 수있는 방법을 고집합니다. 첫째로 제조법은 다음과 같습니다.요리사 멀티 라인 명령
node['freeswitch']['source']['dependencies'].each { |d| package d }
execute "apt_update" do
command "wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -&&"
"echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list &&"
"apt-get update &&"
"apt-get install -y --force-yes freeswitch-video-deps-most &&"
# because we're in a branch that will go through many rebases it's
# better to set this one, or you'll get CONFLICTS when pulling (update)
git config --global pull.rebase true
end
다음은 에러 출력 &&
쉘의 논리 연산자 and
NoMethodError
-------------
No resource or method named `command' for `Chef::Recipe "source"'
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/freeswitch/recipes/source.rb:6:in `from_file'
/var/chef/cache/cookbooks/freeswitch/recipes/default.rb:5:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/freeswitch/recipes/source.rb:
1: #include_recipe 'apt'
2:
3: node['freeswitch']['source']['dependencies'].each { |d| package d }
4:
5: execute "apt_update"
6>> command 'wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -'&&
7: 'echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list' &&
8: 'apt-get update' &&
9: 'apt-get install -y --force-yes freeswitch-video-deps-most' &&
10:
11: # because we're in a branch that will go through many rebases it's
12: # better to set this one, or you'll get CONFLICTS when pulling (update)
13: 'git config --global pull.rebase true'
14:
15: execute "git_clone" do
Platform:
---------
x86_64-linux
Running handlers:
[2016-08-02T09:19:35+01:00] ERROR: Running exception handlers
Running handlers complete
[2016-08-02T09:19:35+01:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 seconds
[2016-08-02T09:19:35+01:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-08-02T09:19:35+01:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-08-02T09:19:35+01:00] ERROR: No resource or method named `command' for `Chef::Recipe "source"'
[2016-08-02T09:19:35+01:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[remote_file] (https://docs.chef.io/resource_remote_file.html), [apt cookbook] (https://supermarket.chef.io/)과 같이 리소스를 Chef와 우리에게 익숙하게하십시오. cookbooks/apt) 및 [package] (https://docs.chef.io/resource_package.html) 리소스를 참조하십시오. Chef를 쉘 스크립트의 주자로 사용하지 마십시오. 너는 그것으로 재미를 느끼지 않을 것이다. – StephenKing
소스에서 실행하는이 인스턴스가 기본 옵션입니다. – jaseUK