- From: Andrea Campi <
>
- To:
- Subject: [chef] Re: Re: Re: chef_gem vs gem_package vs the conundrum
- Date: Fri, 24 Aug 2012 13:46:10 +0200
On Fri, Aug 24, 2012 at 1:33 PM, Leif Madsen
<
>
wrote:
>
Ya I knew that chef_gem did a Gem.clear_paths, but the requirement of
>
development libraries was the sticking point there (since if the gem
>
requires compilation, and you try to install it prior to convergence, you
>
wouldn't have the build-essential stuff installed yet).
Depending on what you are doing exactly, a good pattern is to put a
begin…rescue around your require *and* the code that uses the library.
The goal here is to make the case where you can't load the library
harmless, logging an error and moving on.
For example, if you are writing an LWRP, you could just make it no-op
if the gem can't be loaded.
As long as you have some monitoring system that will alert you to this
problem, this should be failproof.
Andrea
Archive powered by MHonArc 2.6.16.