[chef] Re: howto install a ruby gem that's a pre-req of a chef recipe


Chronological Thread 
  • From: AJ Christensen < >
  • To:
  • Subject: [chef] Re: howto install a ruby gem that's a pre-req of a chef recipe
  • Date: Wed, 15 Aug 2012 15:15:34 +1200

I believe the s3_file cookbook on the community site is now written in
pure ruby (uses OpenSSL to generate the headers), so this is no longer
necessary.

Regardless, the solution is to use the 'chef_gem' resource during
0.10.x (or the chef_gem cookbook for <= 0.10.10*)

chef_gem "aws-s3"

Also, you can manipulate and fire the resource created by the DSL (the
'old way') during compile time:

r = gem_package("aws-s3") { action :nothing }
r.run_action(:install)

Cheers,

--AJ

On 15 August 2012 14:55, Joshua Blatt 
< >
 wrote:
> Hi guys,
>
> Wondering if you can help me with a little ordering issue.
>
> I want to create a library with an s3_file resource and provider:  
> https://gist.github.com/470321
>
> That code depends on the aws-s3 ruby gem http://amazon.rubyforge.org
>
> My reading of http://wiki.opscode.com/display/chef/Anatomy+of+a+Chef+Run ;
> makes me think the gem won't be installed until the execution phase but 
> it'll be ruby required in the compilation phase.
>
> Is there a way to install a ruby gem earlier in the process?   Seems like 
> the sort of thing that'd be really useful every once in a while.
>
> Thanks,
>
> Josh



Archive powered by MHonArc 2.6.16.

§