2013-03-14 2 views
5

기본 패키지가 설치되고 전에 보석 설치가요리사 실행 중에 기본 확장 패키지 후 보석을 설치

package "libxslt-dev" 
package "libxml2-dev" 

chef_gem "fog" 

이 실패하도록 보석 설치가 발생하지만 내가 요리사의 조리법에 안개 보석을 설치하려고 결과는

[Thu, 14 Mar 2013 13:04:30 +0000] INFO: Processing chef_gem[fog] action install (ebs4000::update_volumes line 23) 
[Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Running exception handlers 
[Thu, 14 Mar 2013 13:04:52 +0000] FATAL: Saving node information to /var/cache/chef/failed-run-data.json 
[Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Exception handlers complete 
[Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Gem::Installer::ExtensionBuildError: chef_gem[fog] (cookbook::recipe line 4) had an error: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /usr/bin/ruby1.8 extconf.rb 
checking for libxml/parser.h... no 
----- 
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies. 
----- 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    ... 
    --with-pkg-config 
    --without-pkg-config 


Gem files will remain installed in /var/lib/gems/1.8/gems/nokogiri-1.5.6 for inspection. 
Results logged to /var/lib/gems/1.8/gems/nokogiri-1.5.6/ext/nokogiri/gem_make.out 

요리사 자원의 notifies 속성을 알고 있지만 여전히 제대로 실행될 수 있습니다.

그래서 실제로 어떻게 실행 순서를 먼저 실행하여 네이티브 패키지를 설치 한 다음 동일한 실행으로 젬을 설치해야합니까?

참고 : 패키지를 수동으로 설치하는 것은 새로운 노드에 대해 완전히 자동화되기를 바라기 때문에 옵션이 아닙니다.

답변

7

여기에 언급 한 바와 같이, 자원 수집 단계의 시작 종속성을 설치하지 이유 : OPSCODE wiki: Run Resources from the Resource Collection

그래서 당신의 조리법과 같을 것이다 : 당신이 이미하고있는 것처럼

xsltdev = package "libxslt-dev" do 
    action :nothing 
end 

xmldev = package "libxml2-dev" do 
    action :nothing 
end 

xsltdev.run_action(:install) 
xmldev.run_action(:install) 

chef_gem "fog" 
+0

감사합니다. – vervas

+0

또한 패키지리스트를 다음 디렉토리에 설치할 수 있습니다 : '% w {libxslt-dev libxml2-dev} .each do | pkg | p = 패키지 pkg do 작업 : 없음 끝 p.run_action (: install) end' – Brett

0

보인다 그. 조리법은 순서대로 수행되므로 잘 먹어야합니다.

로그에는 요리사가 fog을 설치하려고 시도한 시점부터 발생한 상황 만 표시됩니다. 그 전에 lib 패키지의 설치가 완료되지 않았는지 확인 했습니까? 패키지 이름을 잘못 입력했거나 패키지 관리자의 캐시를 업데이트해야합니다.

+0

패키지 명령이 아직 실행되지 않았기 때문에 그 전에 로그를 포함하지 않았습니다. 나에게 그것은 보석 수집 단계에 패키지 설치가 진행되는 동안 자원 수집 단계에 설치되는 것처럼 보입니다. 그래서 이것이 문제가 IMHO에서 발생하는 이유입니다. – vervas