# Ruby Gems

**URL:** <https://discourse.chef.io/t/ruby-gems/6448>\
**Category:** Chef Infra (archive)\
**Created:** [March 25, 2015, 2:54pm UTC](https://discourse.chef.io/t/ruby-gems/6448 "2015-03-25T14:54:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Hawkins](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Simon\_Hawkins](https://discourse.chef.io/u/Simon_Hawkins)\
**Post date:** [March 25, 2015, 2:54pm UTC](https://discourse.chef.io/t/ruby-gems/6448/1 "2015-03-25T14:54:55Z")

</div>

All,

When I am bootstrapping a windows box I get this:

20: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
21: # See the License for the specific language governing permissions and  
22: # limitations under the License.  
23: #  
24:  
25: if RUBY\_PLATFORM =~ /mswin|mingw32|windows/  
26: require 'win32/registry’  
27\>\> require 'ruby-wmi’  
28: end  
29:  
30: module Windows  
31: module RegistryHelper

Do I need ruby installed on my Windows Image before I can bootstrap it? Should the chef-client install push it out on a bootstrap?

Cheers,  
Simon.

* * *

Disclaimer

This message is intended only for the use of the person(s) (“Intended Recipient”) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861

* * *

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [March 25, 2015, 2:58pm UTC](https://discourse.chef.io/t/ruby-gems/6448/2 "2015-03-25T14:58:41Z")

</div>

On Wednesday, March 25, 2015 at 7:54 AM, Simon Hawkins wrote:

> All,
> 
> When I am bootstrapping a windows box I get this:
> 
> 20: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
> 21: # See the License for the specific language governing permissions and  
> 22: # limitations under the License.  
> 23: #  
> 24:  
> 25: if RUBY\_PLATFORM =~ /mswin|mingw32|windows/  
> 26: require 'win32/registry'  
> 27\>\> require 'ruby-wmi'  
> 28: end  
> 29:  
> 30: module Windows  
> 31: module RegistryHelper
> 
> Do I need ruby installed on my Windows Image before I can bootstrap it? Should the chef-client install push it out on a bootstrap?
> 
> Cheers,  
> Simon.

What cookbook is this from? I seem to remember that chef-client used to include ruby-wmi when installing on windows, but we had some problems with it (something about it not working with certain ruby versions) and weren’t using most of the features so we wrote a replacement for just the features we needed: [GitHub - chef/wmi-lite: Lightweight, low-dependency wrapper for basic WMI functionality on Windows.](https://github.com/chef/wmi-lite)

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Simon\_Hawkins](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Simon\_Hawkins](https://discourse.chef.io/u/Simon_Hawkins)\
**Post date:** [March 25, 2015, 4:12pm UTC](https://discourse.chef.io/t/ruby-gems/6448/3 "2015-03-25T16:12:23Z")

</div>

Hi Daniel,

I think it is this version which causes the error:

windows 1.31.0

I guess I can install wmi-lite on my chef workstation and change the dependency in the windows cookbook?

Cheers,

Simon

-----Original Message-----  
From: Daniel DeLeo [[mailto:ddeleo@kallistec.com](mailto:ddeleo@kallistec.com)] On Behalf Of Daniel DeLeo  
Sent: 25 March 2015 14:59  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: Ruby Gems

On Wednesday, March 25, 2015 at 7:54 AM, Simon Hawkins wrote:

> All,
> 
> When I am bootstrapping a windows box I get this:
> 
> 20: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
> 21: # See the License for the specific language governing permissions and  
> 22: # limitations under the License.  
> 23: #  
> 24:  
> 25: if RUBY\_PLATFORM =~ /mswin|mingw32|windows/  
> 26: require 'win32/registry'  
> 27\>\> require 'ruby-wmi'  
> 28: end  
> 29:  
> 30: module Windows  
> 31: module RegistryHelper
> 
> Do I need ruby installed on my Windows Image before I can bootstrap it? Should the chef-client install push it out on a bootstrap?
> 
> Cheers,  
> Simon.

What cookbook is this from? I seem to remember that chef-client used to include ruby-wmi when installing on windows, but we had some problems with it (something about it not working with certain ruby versions) and weren’t using most of the features so we wrote a replacement for just the features we needed: [GitHub - chef/wmi-lite: Lightweight, low-dependency wrapper for basic WMI functionality on Windows.](https://github.com/chef/wmi-lite)

--  
Daniel DeLeo

* * *

Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861

* * *

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [March 25, 2015, 6:31pm UTC](https://discourse.chef.io/t/ruby-gems/6448/4 "2015-03-25T18:31:02Z")

</div>

On Wednesday, March 25, 2015 at 9:12 AM, Simon Hawkins wrote:

> Hi Daniel,
> 
> I think it is this version which causes the error:
> 
> windows 1.31.0
> 
> I guess I can install wmi-lite on my chef workstation and change the dependency in the windows cookbook?
> 
> Cheers,
> 
> Simon  
> The wmi-lite gem will be installed automatically when you install chef on windows. Just changing the dependency in the windows cookbook is unlikely to work without further changes to update other code to use wmi-lite and it’s possible that wmi-lite is missing some functionality used by the cookbook. I’ve reached out to my colleagues who are more familiar with the windows cookbook to help answer your question, but for now if you install the `ruby-wmi` gem it should work around the problem for the time being.

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [March 25, 2015, 6:35pm UTC](https://discourse.chef.io/t/ruby-gems/6448/5 "2015-03-25T18:35:14Z")

</div>

On Wednesday, March 25, 2015 at 11:31 AM, Daniel DeLeo wrote:

> On Wednesday, March 25, 2015 at 9:12 AM, Simon Hawkins wrote:
> 
> > Hi Daniel,
> > 
> > I think it is this version which causes the error:
> > 
> > windows 1.31.0
> > 
> > I guess I can install wmi-lite on my chef workstation and change the dependency in the windows cookbook?
> > 
> > Cheers,
> > 
> > Simon
> 
> The wmi-lite gem will be installed automatically when you install chef on windows. Just changing the dependency in the windows cookbook is unlikely to work without further changes to update other code to use wmi-lite and it’s possible that wmi-lite is missing some functionality used by the cookbook. I’ve reached out to my colleagues who are more familiar with the windows cookbook to help answer your question, but for now if you install the `ruby-wmi` gem it should work around the problem for the time being.
> 
> --  
> Daniel DeLeo

I asked a colleague and he said the version of the cookbook you’re using doesn’t work with current versions of Chef. Looks like the current version is 1.36.6. Can you try using the latest?

> <https://github.com/chef-boneyard/windows/blob/master/metadata.rb>

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Simon\_Hawkins](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Simon\_Hawkins](https://discourse.chef.io/u/Simon_Hawkins)\
**Post date:** [March 26, 2015, 8:41am UTC](https://discourse.chef.io/t/ruby-gems/6448/6 "2015-03-26T08:41:21Z")

</div>

Hi Daniel,

Thanks for that. 🙂

When I try and download it (knife download cookbook windows) I get this:

Which version do you want to download?

1. windows 1.30.2
2. windows 1.31.0

I assume I have to update my chef-repo to get the latest version?

Cheers,  
Simon  
-----Original Message-----  
From: Daniel DeLeo [[mailto:ddeleo@kallistec.com](mailto:ddeleo@kallistec.com)] On Behalf Of Daniel DeLeo  
Sent: 25 March 2015 18:35  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: RE: Re: Ruby Gems

On Wednesday, March 25, 2015 at 11:31 AM, Daniel DeLeo wrote:

> On Wednesday, March 25, 2015 at 9:12 AM, Simon Hawkins wrote:
> 
> > Hi Daniel,
> > 
> > I think it is this version which causes the error:
> > 
> > windows 1.31.0
> > 
> > I guess I can install wmi-lite on my chef workstation and change the dependency in the windows cookbook?
> > 
> > Cheers,
> > 
> > Simon
> 
> The wmi-lite gem will be installed automatically when you install chef on windows. Just changing the dependency in the windows cookbook is unlikely to work without further changes to update other code to use wmi-lite and it’s possible that wmi-lite is missing some functionality used by the cookbook. I’ve reached out to my colleagues who are more familiar with the windows cookbook to help answer your question, but for now if you install the `ruby-wmi` gem it should work around the problem for the time being.
> 
> --  
> Daniel DeLeo

I asked a colleague and he said the version of the cookbook you’re using doesn’t work with current versions of Chef. Looks like the current version is 1.36.6. Can you try using the latest?

> <https://github.com/chef-boneyard/windows/blob/master/metadata.rb>

--  
Daniel DeLeo

* * *

Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861

* * *

---

<div class="post-metadata">

**Author:** ![Simon\_Hawkins](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Simon\_Hawkins](https://discourse.chef.io/u/Simon_Hawkins)\
**Post date:** [March 26, 2015, 11:33am UTC](https://discourse.chef.io/t/ruby-gems/6448/7 "2015-03-26T11:33:11Z")

</div>

Hi All,

Don't worry, I downloaded it (chef knowledge is coming back!) 🙂

Cheers,  
Simon.

-----Original Message-----  
From: Simon Hawkins [[mailto:Simon.Hawkins@totaljobsgroup.com](mailto:Simon.Hawkins@totaljobsgroup.com)]  
Sent: 26 March 2015 08:41  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] RE: Re: RE: Re: Ruby Gems

Hi Daniel,

Thanks for that. 🙂

When I try and download it (knife download cookbook windows) I get this:

Which version do you want to download?

1. windows 1.30.2
2. windows 1.31.0

I assume I have to update my chef-repo to get the latest version?

Cheers,  
Simon  
-----Original Message-----  
From: Daniel DeLeo [[mailto:ddeleo@kallistec.com](mailto:ddeleo@kallistec.com)] On Behalf Of Daniel DeLeo  
Sent: 25 March 2015 18:35  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: RE: Re: Ruby Gems

On Wednesday, March 25, 2015 at 11:31 AM, Daniel DeLeo wrote:

> On Wednesday, March 25, 2015 at 9:12 AM, Simon Hawkins wrote:
> 
> > Hi Daniel,
> > 
> > I think it is this version which causes the error:
> > 
> > windows 1.31.0
> > 
> > I guess I can install wmi-lite on my chef workstation and change the dependency in the windows cookbook?
> > 
> > Cheers,
> > 
> > Simon
> 
> The wmi-lite gem will be installed automatically when you install chef on windows. Just changing the dependency in the windows cookbook is unlikely to work without further changes to update other code to use wmi-lite and it’s possible that wmi-lite is missing some functionality used by the cookbook. I’ve reached out to my colleagues who are more familiar with the windows cookbook to help answer your question, but for now if you install the `ruby-wmi` gem it should work around the problem for the time being.
> 
> --  
> Daniel DeLeo

I asked a colleague and he said the version of the cookbook you’re using doesn’t work with current versions of Chef. Looks like the current version is 1.36.6. Can you try using the latest?

> <https://github.com/chef-boneyard/windows/blob/master/metadata.rb>

--  
Daniel DeLeo

* * *

Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861

* * *
