# Invidious choices 101: Chef (\<= 0.10) vs Vagrant

**URL:** <https://discourse.chef.io/t/invidious-choices-101-chef-0-10-vs-vagrant/1759>\
**Category:** Chef Infra (archive)\
**Created:** [March 30, 2011, 7:54am UTC](https://discourse.chef.io/t/invidious-choices-101-chef-0-10-vs-vagrant/1759 "2011-03-30T07:54:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hedgehog](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/hedgehog/32/620_2.png) [@hedgehog](https://discourse.chef.io/u/hedgehog)\
**Post date:** [March 30, 2011, 7:54am UTC](https://discourse.chef.io/t/invidious-choices-101-chef-0-10-vs-vagrant/1759/1 "2011-03-30T07:54:38Z")

</div>

Hi,  
Due to Chef pinning the json gem at \<=1.4.6 you can’t use vagrant in  
the same ruby gem environment as Chef…  
This issue is proving to be a blocker in the quest to reuse Cucumber  
steps in Vagrant+Chef use cases.

What methods are people adopting to use Chef and Vagrant in the same project?

At the moment all I can think of is to try switch gemsets with RVM  
whenever you need to use `knife ...`, but I’m open to any other  
suggestions  
Specifically, I see the current master still has Chef pinning json gem  
at \<=1.4.6. So I assume this restriction will be around for some  
considerable time. That means any workaround that is not clean/easy  
gets a look in 🙂

Appreciate any hints or tips.

–  
πόλλ’ οἶδ ἀλώπηξ, ἀλλ’ ἐχῖνος ἓν μέγα  
[The fox knows many things, but the hedgehog knows one big thing.]  
Archilochus, Greek poet (c. 680 BC – c. 645 BC)  
[http://wiki.hedgehogshiatus.com](http://wiki.hedgehogshiatus.com)

---

<div class="post-metadata">

**Author:** ![Tim\_Diggins](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tim_diggins/32/810_2.png) [@Tim\_Diggins](https://discourse.chef.io/u/Tim_Diggins)\
**Post date:** [March 30, 2011, 8:43pm UTC](https://discourse.chef.io/t/invidious-choices-101-chef-0-10-vs-vagrant/1759/2 "2011-03-30T20:43:53Z")

</div>

What do you mean by "using vagrant and chef in the same project". I'm using  
chef as a provisioner (primarily as a means to test my chef recipes/roles in  
a speedy environment (switching vagrant between a chef-solo (for speed) and  
chef server model (to the platform, for testing more advanced configs). But  
I don't think that's what you meant. (I notice that vagrant during a  
"vagrant provision" run seems to use an earlier version of chef than the  
latest one I have installed - is gem dependency management that clever?)

Tim

On Wed, Mar 30, 2011 at 8:54 AM, Hedge Hog [hedgehogshiatus@gmail.com](mailto:hedgehogshiatus@gmail.com)wrote:

> Hi,  
> Due to Chef pinning the json gem at \<=1.4.6 you can't use vagrant in  
> the same ruby gem environment as Chef....  
> This issue is proving to be a blocker in the quest to reuse Cucumber  
> steps in Vagrant+Chef use cases.
> 
> What methods are people adopting to use Chef and Vagrant in the same  
> project?
> 
> At the moment all I can think of is to try switch gemsets with RVM  
> whenever you need to use `knife ...`, but I'm open to any other  
> suggestions  
> Specifically, I see the current master still has Chef pinning json gem  
> at \<=1.4.6. So I assume this restriction will be around for some  
> considerable time. That means any workaround that is not clean/easy  
> gets a look in 🙂
> 
> Appreciate any hints or tips.
> 
> --  
> πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα  
> [The fox knows many things, but the hedgehog knows one big thing.]  
> Archilochus, Greek poet (c. 680 BC – c. 645 BC)  
> [http://wiki.hedgehogshiatus.com](http://wiki.hedgehogshiatus.com)

---

<div class="post-metadata">

**Author:** ![hedgehog](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/hedgehog/32/620_2.png) [@hedgehog](https://discourse.chef.io/u/hedgehog)\
**Post date:** [March 30, 2011, 8:53pm UTC](https://discourse.chef.io/t/invidious-choices-101-chef-0-10-vs-vagrant/1759/3 "2011-03-30T20:53:32Z")

</div>

On Thu, Mar 31, 2011 at 7:43 AM, Tim Diggins [tim@red56.co.uk](mailto:tim@red56.co.uk) wrote:

> What do you mean by "using vagrant and chef in the same project".

One Gemfile with both present, and I don't think groups allow you to  
sidestep this.

> I'm using  
> chef as a provisioner (primarily as a means to test my chef recipes/roles in  
> a speedy environment (switching vagrant between a chef-solo (for speed) and  
> chef server model (to the platform, for testing more advanced configs). But  
> I don't think that's what you meant. (I notice that vagrant during a  
> "vagrant provision" run seems to use an earlier version of chef than the  
> latest one I have installed - is gem dependency management that clever?)

Could be or Vagrant adjusts the load path so the Chef it cah use is  
encountered first - I haven't looked into the code that closely.  
I think I have a (non-trivial) workaround, that is transparent to the  
library user, just exploring it now....

> Tim  
> On Wed, Mar 30, 2011 at 8:54 AM, Hedge Hog [hedgehogshiatus@gmail.com](mailto:hedgehogshiatus@gmail.com)  
> wrote:
> 
> > Hi,  
> > Due to Chef pinning the json gem at \<=1.4.6 you can't use vagrant in  
> > the same ruby gem environment as Chef....  
> > This issue is proving to be a blocker in the quest to reuse Cucumber  
> > steps in Vagrant+Chef use cases.
> > 
> > What methods are people adopting to use Chef and Vagrant in the same  
> > project?
> > 
> > At the moment all I can think of is to try switch gemsets with RVM  
> > whenever you need to use `knife ...`, but I'm open to any other  
> > suggestions  
> > Specifically, I see the current master still has Chef pinning json gem  
> > at \<=1.4.6. So I assume this restriction will be around for some  
> > considerable time. That means any workaround that is not clean/easy  
> > gets a look in 🙂
> > 
> > Appreciate any hints or tips.
> > 
> > --  
> > πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα  
> > [The fox knows many things, but the hedgehog knows one big thing.]  
> > Archilochus, Greek poet (c. 680 BC – c. 645 BC)  
> > [http://wiki.hedgehogshiatus.com](http://wiki.hedgehogshiatus.com)

--  
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα  
[The fox knows many things, but the hedgehog knows one big thing.]  
Archilochus, Greek poet (c. 680 BC – c. 645 BC)  
[http://wiki.hedgehogshiatus.com](http://wiki.hedgehogshiatus.com)

---

<div class="post-metadata">

**Author:** ![Michael\_Hale](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/michael_hale/32/834_2.png) [@Michael\_Hale](https://discourse.chef.io/u/Michael_Hale)\
**Post date:** [March 30, 2011, 8:59pm UTC](https://discourse.chef.io/t/invidious-choices-101-chef-0-10-vs-vagrant/1759/4 "2011-03-30T20:59:36Z")

</div>

On Wed, Mar 30, 2011 at 4:53 PM, Hedge Hog [hedgehogshiatus@gmail.com](mailto:hedgehogshiatus@gmail.com) wrote:

> On Thu, Mar 31, 2011 at 7:43 AM, Tim Diggins [tim@red56.co.uk](mailto:tim@red56.co.uk) wrote:
> 
> > What do you mean by "using vagrant and chef in the same project".
> 
> One Gemfile with both present, and I don't think groups allow you to  
> sidestep this.
> 
> > I'm using  
> > chef as a provisioner (primarily as a means to test my chef recipes/roles in  
> > a speedy environment (switching vagrant between a chef-solo (for speed) and  
> > chef server model (to the platform, for testing more advanced configs). But  
> > I don't think that's what you meant. (I notice that vagrant during a  
> > "vagrant provision" run seems to use an earlier version of chef than the  
> > latest one I have installed - is gem dependency management that clever?)
> 
> Could be or Vagrant adjusts the load path so the Chef it cah use is  
> encountered first - I haven't looked into the code that closely.  
> I think I have a (non-trivial) workaround, that is transparent to the  
> library user, just exploring it now....

I think vagrant has it's own seperate install of chef actually on the  
vagrant instance that it uses. I was able to see the details by grep  
the vagrant gem for references to chef-client or chef-solo.

> > Tim  
> > On Wed, Mar 30, 2011 at 8:54 AM, Hedge Hog [hedgehogshiatus@gmail.com](mailto:hedgehogshiatus@gmail.com)  
> > wrote:
> > 
> > > Hi,  
> > > Due to Chef pinning the json gem at \<=1.4.6 you can't use vagrant in  
> > > the same ruby gem environment as Chef....  
> > > This issue is proving to be a blocker in the quest to reuse Cucumber  
> > > steps in Vagrant+Chef use cases.
> > > 
> > > What methods are people adopting to use Chef and Vagrant in the same  
> > > project?
> > > 
> > > At the moment all I can think of is to try switch gemsets with RVM  
> > > whenever you need to use `knife ...`, but I'm open to any other  
> > > suggestions  
> > > Specifically, I see the current master still has Chef pinning json gem  
> > > at \<=1.4.6. So I assume this restriction will be around for some  
> > > considerable time. That means any workaround that is not clean/easy  
> > > gets a look in 🙂
> > > 
> > > Appreciate any hints or tips.
> > > 
> > > --  
> > > πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα  
> > > [The fox knows many things, but the hedgehog knows one big thing.]  
> > > Archilochus, Greek poet (c. 680 BC – c. 645 BC)  
> > > [http://wiki.hedgehogshiatus.com](http://wiki.hedgehogshiatus.com)
> 
> --  
> πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα  
> [The fox knows many things, but the hedgehog knows one big thing.]  
> Archilochus, Greek poet (c. 680 BC – c. 645 BC)  
> [http://wiki.hedgehogshiatus.com](http://wiki.hedgehogshiatus.com)

---

<div class="post-metadata">

**Author:** ![Haselwanter\_Edmund](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/haselwanter_edmund/32/635_2.png) [@Haselwanter\_Edmund](https://discourse.chef.io/u/Haselwanter_Edmund)\
**Post date:** [March 30, 2011, 9:47pm UTC](https://discourse.chef.io/t/invidious-choices-101-chef-0-10-vs-vagrant/1759/5 "2011-03-30T21:47:21Z")

</div>

On 30.03.2011, at 22:53, Hedge Hog wrote:

> On Thu, Mar 31, 2011 at 7:43 AM, Tim Diggins [tim@red56.co.uk](mailto:tim@red56.co.uk) wrote:
> 
> > What do you mean by "using vagrant and chef in the same project".

Hm. What are you trying to do?

Host machine with vagrant gem  
Client machine with chef-client gem

Where do they interfere?

## cu edi

DI Edmund Haselwanter, [edmund@haselwanter.com](mailto:edmund@haselwanter.com), [http://edmund.haselwanter.com/](http://edmund.haselwanter.com/)  
[http://www.iteh.at](http://www.iteh.at) | [http://facebook.com/iTeh.solutions](http://facebook.com/iTeh.solutions) | [http://at.linkedin.com/in/haselwanteredmund](http://at.linkedin.com/in/haselwanteredmund)

---

<div class="post-metadata">

**Author:** ![hedgehog](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/hedgehog/32/620_2.png) [@hedgehog](https://discourse.chef.io/u/hedgehog)\
**Post date:** [March 30, 2011, 10:28pm UTC](https://discourse.chef.io/t/invidious-choices-101-chef-0-10-vs-vagrant/1759/6 "2011-03-30T22:28:15Z")

</div>

On Thu, Mar 31, 2011 at 8:47 AM, Haselwanter Edmund  
[edmund@haselwanter.com](mailto:edmund@haselwanter.com) wrote:

> On 30.03.2011, at 22:53, Hedge Hog wrote:
> 
> > On Thu, Mar 31, 2011 at 7:43 AM, Tim Diggins [tim@red56.co.uk](mailto:tim@red56.co.uk) wrote:
> > 
> > > What do you mean by "using vagrant and chef in the same project".
> 
> Hm. What are you trying to do?

run  
vagrant ...  
kife ....  
in an env that is setup with one Gemfile.

> Host machine with vagrant gem  
> Client machine with chef-client gem
> 
> Where do they interfere?
> 
> ## cu edi
> 
> DI Edmund Haselwanter, [edmund@haselwanter.com](mailto:edmund@haselwanter.com), [http://edmund.haselwanter.com/](http://edmund.haselwanter.com/)  
> [http://www.iteh.at](http://www.iteh.at) | [Facebook](http://facebook.com/iTeh.solutions) | [http://at.linkedin.com/in/haselwanteredmund](http://at.linkedin.com/in/haselwanteredmund)

--  
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα  
[The fox knows many things, but the hedgehog knows one big thing.]  
Archilochus, Greek poet (c. 680 BC – c. 645 BC)  
[http://wiki.hedgehogshiatus.com](http://wiki.hedgehogshiatus.com)
