On Tuesday, March 5, 2013 at 3:17 PM, Philippe Bérard wrote:
I don't know if I do it correctly, but here's my answer.Just do it that way :chef_gem 'treetop'require 'treetop'It will be installed at the right time before being loaded by the recipe.Regards,-- Philippe Bérard-----Message d'origine-----De : Sam Darwin [ ">mailto: ]Envoyé : mardi 5 mars 2013 10:29À : ">Objet : [chef] library gem dependenciesLet's say a cookbook library requires a gem called treetop (it could be anygem actually), and so it has this line:require 'treetop'I want to get that installed as a pre-requisite, and so I add this code intothe default recipe:r = chef_gem "treetop" doaction :nothingendr.run_action(:install)But apparently it won't get called soon enough. The library has errorsabouttreetop missing.As another attempt, I create a different cookbook called pre-requisites. Iadd the code "r = chef_gem "treetop" do" into the pre-requisites cookbook,andhave that as a cookbook dependency. Nope. This also doesn't get calledsoonenough. treetop is missing. Installing the treetop gem by hand willfixit.The issue seems to be with a library and not with a recipe file, that is thetwist.
Archive powered by MHonArc 2.6.16.