Recall that the Chef client run processes recipes in two phases[0] - theThanks a lot, seems I got it. Are there other cookbooks exploiting the similar idea?
compile phase and the execution phase. During the compile phase your Ruby
code is processed:
r1 = package "ruby1.8-dev"
r1.run_action(:install)
So this gets evaluated and the resource is created and the package installed.
The mysql cookbook uses this 'trick' to ensure the mysql gem can be installed
and later used in the mysql cookbook's library in the same Chef client run.
The build-essential and ruby cookbooks do not do this (the Opscode Ruby
cookbook installs the ruby dev package, so you can use that). They create the
package resources during the compile phase as normal but Chef doesn't
actually run the package installation until the execution phase. You should
modify your local copy of the build-essential recipe to have the following
block for the package installation:
Archive powered by MHonArc 2.6.16.