[chef] Re: RE: library gem dependencies


Chronological Thread 
  • From: Sachin Sagar Rai < >
  • To:
  • Cc: Sam Darwin < >
  • Subject: [chef] Re: RE: library gem dependencies
  • Date: Tue, 5 Mar 2013 15:20:03 +0545

Yup, mine too is working the chef_gem way:

%w(libxml2-dev libxslt1-dev libcurl4-gnutls-dev).each do |pkg|
  r = package pkg do
    action :nothing
  end
  r.run_action(:install)
end

chef_gem "aws-sdk"
require 'aws'

-------------------------------------------
@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

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-----
Envoyé : mardi 5 mars 2013 10:29
Objet : [chef] library gem dependencies


Let's say a cookbook library requires a gem called treetop (it could be any
gem 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 into
the default recipe:

r = chef_gem "treetop" do
action :nothing
end
r.run_action(:install)

But apparently it won't get called soon enough. The library has errors
about
treetop missing.

As another attempt, I create a different cookbook called pre-requisites. I
add the code "r = chef_gem "treetop" do" into the pre-requisites cookbook,
and
have that as a cookbook dependency. Nope. This also doesn't get called
soon
enough. treetop is missing. Installing the treetop gem by hand will
fix
it.

The issue seems to be with a library and not with a recipe file, that is the
twist.




Archive powered by MHonArc 2.6.16.

§