- From: Mike <
>
- To: "
" <
>
- Subject: [chef] Re: Re: chef_gem vs. gem_package
- Date: Mon, 5 Aug 2013 14:08:09 -0400
To further elaborate, using the `gem_binary_location` variable to
specify exactly which gem environment you want the installed gem under
(if you have multiple installations) is the way to go.
-M
On Mon, Aug 5, 2013 at 1:25 PM, Scott M. Likens
<
>
wrote:
>
Sam,
>
>
Sounds like http://docs.opscode.com/resource.html is a bit off. Perhaps my
>
history is off, but if I recall chef_gem was created as a helper to install
>
the gem during the compilation phase and reload the gem path so you can load
>
said gem in your cookbook.
>
>
Reviewing
>
https://github.com/opscode/chef/blob/11.6.0/lib/chef/resource/chef_gem.rb#L43-49
>
does appear to make this assumption true. chef_gem is using the same
>
resource to install gems, it just has the after command to reload the gem
>
path.
>
>
https://github.com/opscode/chef/blob/11.6.0/lib/chef/resource/gem_package.rb
>
>
So you use gem_package if you want the gem installed during the regular
>
cookbook run; if you need to use the gem in your cookbooks you should use
>
chef_gem.
>
>
Yeah it sounds like there's a documentation ticket in the brew for this
>
resource, at least my knowledge conflicts with the documentation.
>
>
Scott
>
>
>
>
On 8/5/13 5:31 AM, Sam Darwin wrote:
>
>
>
> from the documentation:
>
>
>
> Warning
>
> The chef_gem and gem_package resources are both used to install Ruby gems.
>
> For
>
> any machine on which Chef is installed, there are two instances of Ruby.
>
> One is
>
> the standard, system-wide instance of Ruby and the other is a dedicated
>
> instance that is available only to Chef. Use the chef_gem resource to
>
> install
>
> gems into the instance of Ruby that is dedicated to Chef. Use the
>
> gem_package
>
> resource to install all other gems (i.e. install gems system-wide).
>
>
>
> from observation:
>
>
>
> gem_package will fall-back to chef_gem behavior if ruby isn't on the
>
> system.
>
> have you seen this? Am I imagining it? The problem is that you don't
>
> get
>
> consistent results from a recipe. If one machine has a system ruby 1.8,
>
> another machine has chef-client (with ruby 1.9) and no system ruby, very
>
> different things can happen with the same recipe. Should the meaning
>
> of
>
> chef_gem vs. gem_package , and the differences between them, be more
>
> enforced?
>
>
>
> !DSPAM:51ff9b3b321631804284693!
>
>
>
Archive powered by MHonArc 2.6.16.