# Berkshelf gem listed as a requirement in cookbook gemfile

**URL:** <https://discourse.chef.io/t/berkshelf-gem-listed-as-a-requirement-in-cookbook-gemfile/6138>\
**Category:** Chef Infra (archive)\
**Created:** [December 31, 2014, 8:03am UTC](https://discourse.chef.io/t/berkshelf-gem-listed-as-a-requirement-in-cookbook-gemfile/6138 "2014-12-31T08:03:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_Jimenez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/william_jimenez/32/181_2.png) [@William\_Jimenez](https://discourse.chef.io/u/William_Jimenez)\
**Post date:** [December 31, 2014, 8:03am UTC](https://discourse.chef.io/t/berkshelf-gem-listed-as-a-requirement-in-cookbook-gemfile/6138/1 "2014-12-31T08:03:06Z")

</div>

Hi Folks,  
I’m noticing that the berkshelf gem is listed as a requirement in Gemfiles  
of a lot of cookbooks I’ve been working with lately. I suspect that this is  
bad behavior now that ChefDK is the recommended deployment method for  
berkshelf. Just wanted to confirm with you all that my reasoning is correct.

Thanks,  
William

---

<div class="post-metadata">

**Author:** ![AJ\_Christensen2](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/aj_christensen2/32/42_2.png) [@AJ\_Christensen2](https://discourse.chef.io/u/AJ_Christensen2)\
**Post date:** [December 31, 2014, 8:07am UTC](https://discourse.chef.io/t/berkshelf-gem-listed-as-a-requirement-in-cookbook-gemfile/6138/2 "2014-12-31T08:07:51Z")

</div>

chefdk includes bundler and berkshelf and the Gemfile will resolve.  
Please try to resolve and report back.

I think it's OK. In some projects, it's not necessary to use a Gemfile any more.

cheers,

--aj

On Wed, Dec 31, 2014 at 9:03 PM, William Jimenez  
[william.jimenez@itsoninc.com](mailto:william.jimenez@itsoninc.com) wrote:

> Hi Folks,  
> I'm noticing that the berkshelf gem is listed as a requirement in Gemfiles  
> of a lot of cookbooks I've been working with lately. I suspect that this is  
> bad behavior now that ChefDK is the recommended deployment method for  
> berkshelf. Just wanted to confirm with you all that my reasoning is correct.
> 
> Thanks,  
> William

---

<div class="post-metadata">

**Author:** ![AJ\_Christensen2](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/aj_christensen2/32/42_2.png) [@AJ\_Christensen2](https://discourse.chef.io/u/AJ_Christensen2)\
**Post date:** [December 31, 2014, 8:13am UTC](https://discourse.chef.io/t/berkshelf-gem-listed-as-a-requirement-in-cookbook-gemfile/6138/3 "2014-12-31T08:13:47Z")

</div>

Yo,

Sorry for the follow up.

It's worth mentioning the ChefDk includes gecode libs, pre-built, for  
all supported target platforms, which greatly alleviates the  
installation heat-cost of Berkshelf.

On machines where this (ChefDK) is not present and the prerequisite  
environment variable and system libraries have not been configured, a  
full installation of gecode from source will be automatically handled  
by the gem (via bundle) installation.

cheers,

--aj

On Wed, Dec 31, 2014 at 9:07 PM, AJ Christensen  
[aj@junglistheavy.industries](mailto:aj@junglistheavy.industries) wrote:

> chefdk includes bundler and berkshelf and the Gemfile will resolve.  
> Please try to resolve and report back.
> 
> I think it's OK. In some projects, it's not necessary to use a Gemfile any more.
> 
> cheers,
> 
> --aj
> 
> On Wed, Dec 31, 2014 at 9:03 PM, William Jimenez  
> [william.jimenez@itsoninc.com](mailto:william.jimenez@itsoninc.com) wrote:
> 
> > Hi Folks,  
> > I'm noticing that the berkshelf gem is listed as a requirement in Gemfiles  
> > of a lot of cookbooks I've been working with lately. I suspect that this is  
> > bad behavior now that ChefDK is the recommended deployment method for  
> > berkshelf. Just wanted to confirm with you all that my reasoning is correct.
> > 
> > Thanks,  
> > William

---

<div class="post-metadata">

**Author:** ![tknerr](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tknerr/32/21_2.png) [@tknerr](https://discourse.chef.io/u/tknerr)\
**Post date:** [December 31, 2014, 12:44pm UTC](https://discourse.chef.io/t/berkshelf-gem-listed-as-a-requirement-in-cookbook-gemfile/6138/4 "2014-12-31T12:44:28Z")

</div>

Hi William,

I think both approaches are OK. Depends on whether you want to require  
a specific berks version globally (via the ChefDK installation) or you  
want to require a specific berks version on a per project level (via  
Gemfile).

Usually I tend to prefer the Gemfile approach because it expresses and  
enforces all its dependencies. On the other hand, if your README  
states that you need ChefDK 0.3.5 as a dependency it's not that bad  
either. It's just if your projects have different release cycles and  
you don't want to update and test all of them whenever you install a  
new ChefDK.

HTH,  
Torben

On Wed, Dec 31, 2014 at 9:13 AM, AJ Christensen  
[aj@junglistheavy.industries](mailto:aj@junglistheavy.industries) wrote:

> Yo,
> 
> Sorry for the follow up.
> 
> It's worth mentioning the ChefDk includes gecode libs, pre-built, for  
> all supported target platforms, which greatly alleviates the  
> installation heat-cost of Berkshelf.
> 
> On machines where this (ChefDK) is not present and the prerequisite  
> environment variable and system libraries have not been configured, a  
> full installation of gecode from source will be automatically handled  
> by the gem (via bundle) installation.
> 
> cheers,
> 
> --aj
> 
> On Wed, Dec 31, 2014 at 9:07 PM, AJ Christensen  
> [aj@junglistheavy.industries](mailto:aj@junglistheavy.industries) wrote:
> 
> > chefdk includes bundler and berkshelf and the Gemfile will resolve.  
> > Please try to resolve and report back.
> > 
> > I think it's OK. In some projects, it's not necessary to use a Gemfile any more.
> > 
> > cheers,
> > 
> > --aj
> > 
> > On Wed, Dec 31, 2014 at 9:03 PM, William Jimenez  
> > [william.jimenez@itsoninc.com](mailto:william.jimenez@itsoninc.com) wrote:
> > 
> > > Hi Folks,  
> > > I'm noticing that the berkshelf gem is listed as a requirement in Gemfiles  
> > > of a lot of cookbooks I've been working with lately. I suspect that this is  
> > > bad behavior now that ChefDK is the recommended deployment method for  
> > > berkshelf. Just wanted to confirm with you all that my reasoning is correct.
> > > 
> > > Thanks,  
> > > William

---

<div class="post-metadata">

**Author:** ![William\_Jimenez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/william_jimenez/32/181_2.png) [@William\_Jimenez](https://discourse.chef.io/u/William_Jimenez)\
**Post date:** [December 31, 2014, 10:34pm UTC](https://discourse.chef.io/t/berkshelf-gem-listed-as-a-requirement-in-cookbook-gemfile/6138/5 "2014-12-31T22:34:30Z")

</div>

Thanks all. That's helpful background and alleviates my concern that a  
Gemfile req. would not detect the ChefDK install and try to install it  
elsewhere and/or reference a non ChefDK version. But I see how it could be  
beneficial to still reference it for some cases.

Happy New Year!

-William

On Wed, Dec 31, 2014 at 4:44 AM, Torben Knerr [mail@tknerr.de](mailto:mail@tknerr.de) wrote:

> Hi William,
> 
> I think both approaches are OK. Depends on whether you want to require  
> a specific berks version globally (via the ChefDK installation) or you  
> want to require a specific berks version on a per project level (via  
> Gemfile).
> 
> Usually I tend to prefer the Gemfile approach because it expresses and  
> enforces all its dependencies. On the other hand, if your README  
> states that you need ChefDK 0.3.5 as a dependency it's not that bad  
> either. It's just if your projects have different release cycles and  
> you don't want to update and test all of them whenever you install a  
> new ChefDK.
> 
> HTH,  
> Torben
> 
> On Wed, Dec 31, 2014 at 9:13 AM, AJ Christensen  
> [aj@junglistheavy.industries](mailto:aj@junglistheavy.industries) wrote:
> 
> > Yo,
> > 
> > Sorry for the follow up.
> > 
> > It's worth mentioning the ChefDk includes gecode libs, pre-built, for  
> > all supported target platforms, which greatly alleviates the  
> > installation heat-cost of Berkshelf.
> > 
> > On machines where this (ChefDK) is not present and the prerequisite  
> > environment variable and system libraries have not been configured, a  
> > full installation of gecode from source will be automatically handled  
> > by the gem (via bundle) installation.
> > 
> > cheers,
> > 
> > --aj
> > 
> > On Wed, Dec 31, 2014 at 9:07 PM, AJ Christensen  
> > [aj@junglistheavy.industries](mailto:aj@junglistheavy.industries) wrote:
> > 
> > > chefdk includes bundler and berkshelf and the Gemfile will resolve.  
> > > Please try to resolve and report back.
> > > 
> > > I think it's OK. In some projects, it's not necessary to use a Gemfile  
> > > any more.
> > > 
> > > cheers,
> > > 
> > > --aj
> > > 
> > > On Wed, Dec 31, 2014 at 9:03 PM, William Jimenez  
> > > [william.jimenez@itsoninc.com](mailto:william.jimenez@itsoninc.com) wrote:
> > > 
> > > > Hi Folks,  
> > > > I'm noticing that the berkshelf gem is listed as a requirement in  
> > > > Gemfiles  
> > > > of a lot of cookbooks I've been working with lately. I suspect that  
> > > > this is  
> > > > bad behavior now that ChefDK is the recommended deployment method for  
> > > > berkshelf. Just wanted to confirm with you all that my reasoning is  
> > > > correct.
> > > > 
> > > > Thanks,  
> > > > William

--  
William Jimenez  
Systems Engineer, Operations  
ItsOn, Inc.  
650-241-8470 {us/pacific}

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel\_Garcia](https://avatars.discourse-cdn.com/v4/letter/n/ad7895/32.png) [@Nico\_Kadel\_Garcia](https://discourse.chef.io/u/Nico_Kadel_Garcia)\
**Post date:** [January 2, 2015, 9:21pm UTC](https://discourse.chef.io/t/berkshelf-gem-listed-as-a-requirement-in-cookbook-gemfile/6138/6 "2015-01-02T21:21:17Z")

</div>

> -----Original Message-----  
> From: AJ Christensen [[mailto:aj@junglistheavy.industries](mailto:aj@junglistheavy.industries)]  
> Sent: Wednesday, December 31, 2014 3:14 AM  
> To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Re: berkshelf gem listed as a requirement in cookbook gemfile
> 
> Yo,
> 
> Sorry for the follow up.
> 
> It's worth mentioning the ChefDk includes gecode libs, pre-built, for all  
> supported target platforms, which greatly alleviates the installation heat-cost of  
> Berkshelf.
> 
> On machines where this (ChefDK) is not present and the prerequisite  
> environment variable and system libraries have not been configured, a full  
> installation of gecode from source will be automatically handled by the gem (via  
> bundle) installation.

It's problematic to compile. I mentioned this week: it requires a C++ compiler, takes hours on a modest VM or lightweight host, especially if the memory allocated is light, and it can cause other issues if the system runs out of swap and RAM.

Nico Kadel-Garcia  
Lead DevOps Engineer  
[nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com)

> cheers,
> 
> --aj
> 
> On Wed, Dec 31, 2014 at 9:07 PM, AJ Christensen [aj@junglistheavy.industries](mailto:aj@junglistheavy.industries)  
> wrote:
> 
> > chefdk includes bundler and berkshelf and the Gemfile will resolve.  
> > Please try to resolve and report back.
> > 
> > I think it's OK. In some projects, it's not necessary to use a Gemfile any more.
> > 
> > cheers,
> > 
> > --aj
> > 
> > On Wed, Dec 31, 2014 at 9:03 PM, William Jimenez  
> > [william.jimenez@itsoninc.com](mailto:william.jimenez@itsoninc.com) wrote:
> > 
> > > Hi Folks,  
> > > I'm noticing that the berkshelf gem is listed as a requirement in  
> > > Gemfiles of a lot of cookbooks I've been working with lately. I  
> > > suspect that this is bad behavior now that ChefDK is the recommended  
> > > deployment method for berkshelf. Just wanted to confirm with you all that  
> > > my reasoning is correct.
> > > 
> > > Thanks,  
> > > William
