2013-05-31 5 views
8

방랑자 설치를 시도 중이며 1.9.3-p327을 기본 루비 버전으로 사용하고 싶습니다. 나는 요리사 솔로와 사서 요리사를 사용하여 방랑 기계를 관리하고 있습니다. 요리사 솔로rbenv에 Ruby 1.9.3 설치 NoMethodError loaded_recipe?

내 방랑 파일 프로비저닝이

config.vm.provision :chef_solo do |chef| 
chef.cookbooks_path = "cookbooks" 
chef.add_recipe "apt" 
chef.add_recipe "build-essential" 
chef.add_recipe "git" 
chef.add_recipe "ruby_build" 
chef.add_recipe "rbenv::system" 
chef.add_recipe "rbenv::vagrant" 
chef.add_recipe "sqlite" 
chef.add_recipe "nodejs" 
chef.add_recipe "mysql" 
chef.add_recipe "redisio" 
chef.add_recipe "redisio::install" 
chef.add_recipe "redisio::redis_gem" 
chef.add_recipe "zlib" 
chef.add_recipe "wkhtmltopdf" 

chef.json = { 
    "rbenv" => { 
    "rubies" => [ "1.9.3-p327" ], 
    "global" => "1.9.3-p327", 
    "gems" => { 
     "1.9.3-p327" => [ 
     { "name" => "bundler" } 
     ] 
    } 
    } 
} 
end 

및 사서 cheff이

site 'http://community.opscode.com/api/v1' 

cookbook 'apt' 
cookbook 'git' 
cookbook 'build-essential' 
cookbook 'rbenv', 
    git: 'https://github.com/fnichol/chef-rbenv.git' 
cookbook 'ruby_build' 
cookbook 'sqlite', 
    git: 'git://github.com/opscode-cookbooks/sqlite.git' 
cookbook 'nodejs', 
    git: 'http://github.com/mdxp/nodejs-cookbook' 
cookbook 'mysql', 
    git: 'git://github.com/opscode-cookbooks/mysql.git' 
cookbook 'redisio', 
    git: 'git://github.com/brianbianco/redisio.git' 
cookbook 'zlib', 
    git: 'git://github.com/opscode-cookbooks/zlib' 
cookbook 'wkhtmltopdf', 
    git: 'git://github.com/firstbanco/chef-wkhtmltopdf.git' 

같은 외모를 검색하고이 두 가지에서 내가 할 수 있어야한다는 cheffile처럼 보인다 유감스럽게도 유랑인 파일을 실행하면 루비 버전을 지정하는 위치가 요리사 - 솔로로 지정되어있는 것처럼 보입니다. 그것은 누군가가 그때와 지금 사이에 요리 책을 업데이트했다고 생각하게하는 어제 오후에 일하고있었습니다. 그래서 난 사서 요리사 설치 전화했을 때 그것을 뽑아 내가 그것을 작동 후 루비 버전을 지정하는 JSON을 주석 경우 ..

================================================================================ 
Error executing action `install` on resource 'rbenv_ruby[1.9.3-p327] (system)' 
================================================================================ 

NoMethodError 
------------- 
undefined method `loaded_recipe?' for #<Chef::RunContext:0x7f34cf773ed0> 

Cookbook Trace: 
--------------- 

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/ruby.rb:88:in `ruby_build_missing?' 
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/ruby.rb:43:in `perform_install' 
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/ruby.rb:33:in `class_from_file' 

Resource Declaration: 
--------------------- 
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/recipes/system.rb 

27: else 
28:  rbenv_ruby rubie 
29: end 

Compiled Resource: 
------------------ 
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/recipes/system.rb:28:in `from_file' 

rbenv_ruby("1.9.3-p327") do 
    retry_delay 2 
    retries 0 
    recipe_name "system" 
    definition "1.9.3-p327" 
    action :install 
    cookbook_name :rbenv 
end 

[2013-05-31T09:55:55+00:00] ERROR: Running exception handlers 
[2013-05-31T09:55:55+00:00] ERROR: Exception handlers complete 
[2013-05-31T09:55:55+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out 
[2013-05-31T09:55:55+00:00] FATAL: NoMethodError: rbenv_ruby[1.9.3-p327] (system) (rbenv::system line 28) had an error: NoMethodError: undefined method `loaded_recipe?' for #<Chef::RunContext:0x7f34cf773ed0> 
Chef never successfully completed! Any errors should be visible in the 
output above. Please fix your recipes so that they properly complete. 

을 흥분했다. rbenv의 버전을 지정해야하는 것처럼 보이지만 신뢰할 수있는 버전은 무엇이며 어디에서 찾을 수 있습니까?

편집 : 또한 json에서 사용자 세부 정보를 지정해야합니다. 시스템 및 사용자 (방랑자) 수준으로 설치하기 때문입니다. 주방장은 방황 상자에있는 루비를 사용하고 있습니다. 여기 rbenv json에 대한 내 업데이트 된 루비 버전이 어떻게 생겼는지입니다.

chef.json = { 
    'rbenv' => { 
    'user_installs' => [ 
     { 
     'user' => 'vagrant', 
     'rubies' => ['1.9.3-p327'], 
     'global' => '1.9.3-p327', 
     'gems' => { 
      '1.9.3-p327' => [ 
      { 'name' => 'bundler' }, 
      { 'name' => 'rake' } 
      ] 
     } 
     } 
    ] 
    }, 

답변

7

이것은이 요리 책에서 사용하는 (솔직히 특이한) 버전 시스템 때문인 것으로 보입니다. 마스터 브랜치는 안정적이지 않지만 가장 최근의 태그 버전으로 돌아 가면 오류가 사라집니다. 나는 사서 요리사보다는 Berkshelf를 사용하지만 어쨌든 내 고정 Berkshelf 라인을 포함해야한다 있도록 구문은 거의 동일 같습니다

cookbook 'rbenv', git: 'git://github.com/fnichol/chef-rbenv.git', ref: "v0.7.2"

ref:가 중요한 비트입니다. 이것은 나를 위해 오류가 해결되었습니다!

+0

감사합니다! 효과가있었습니다. 그 정말로 별난, 방랑자와 선로 env에 관한 모든 blogs는 이것을 언급하지 않는다. – TheLegend