# Chefdk and chruby

**URL:** <https://discourse.chef.io/t/chefdk-and-chruby/5925>\
**Category:** Chef Infra (archive)\
**Created:** [November 12, 2014, 4:49pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925 "2014-11-12T16:49:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_A\_Williams](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/david_a_williams/32/209_2.png) [@David\_A\_Williams](https://discourse.chef.io/u/David_A_Williams)\
**Post date:** [November 12, 2014, 4:49pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925/1 "2014-11-12T16:49:14Z")

</div>

Hello All,

I’m using chruby and chefdk on my mac. I’ve added chefdk’s ruby to chruby so I can switch to it easily. This works great except for the requirement to have /opt/chedk/bin before /opt/chefdk/embedded/bin in the file path since chruby puts all the ruby paths first. I was wondering if anyone had the same setup and what they used to work around it.

Thanks,

David

* * *

CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.

---

<div class="post-metadata">

**Author:** ![Martin\_Cleaver](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Martin\_Cleaver](https://discourse.chef.io/u/Martin_Cleaver)\
**Post date:** [November 16, 2014, 11:47pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925/2 "2014-11-16T23:47:28Z")

</div>

I had some issues, David, with gem executables.

See [Using Chef DK alongside rbenv](https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html)

I'd be interested in official advice - the last I saw was on  
[http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/](http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/)

There is also a ticket somewhere - I posted a comment to David Radcliffe's  
blog with a reference, but my comment has not materialized yet!

Best, Martin

On Wed, Nov 12, 2014 at 11:49 AM, David A. Williams [dwilliams@daxko.com](mailto:dwilliams@daxko.com)  
wrote:

> Hello All,
> 
> I’m using chruby and chefdk on my mac. I’ve added chefdk’s ruby to  
> chruby so I can switch to it easily. This works great except for the  
> requirement to have /opt/chedk/bin before /opt/chefdk/embedded/bin in the  
> file path since chruby puts all the ruby paths first. I was wondering if  
> anyone had the same setup and what they used to work around it.
> 
> Thanks,
> 
> David
> 
> * * *
> 
> CONFIDENTIALITY NOTICE: This electronic mail may contain information that  
> is privileged, confidential, and/or otherwise protected from disclosure to  
> anyone other than its intended recipient(s). Any dissemination or use of  
> this electronic mail or its contents by persons other than the intended  
> recipient(s) is strictly prohibited. If you have received this  
> communication in error, please notify the sender immediately by reply  
> e-mail so that we may correct our internal records. Please then delete the  
> original message. Thank you.

---

<div class="post-metadata">

**Author:** ![Booker\_Bense](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/booker_bense/32/117_2.png) [@Booker\_Bense](https://discourse.chef.io/u/Booker_Bense)\
**Post date:** [November 18, 2014, 3:23pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925/3 "2014-11-18T15:23:52Z")

</div>

Direnv might be a better solution to this problem than chruby.

> **[direnv – unclutter your .profile](https://direnv.net/)**
>
> unclutter your .profile

On Sun, Nov 16, 2014 at 3:47 PM, Martin Cleaver [mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)  
wrote:

> I had some issues, David, with gem executables.
> 
> See [Using Chef DK alongside rbenv](https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html)
> 
> I'd be interested in official advice - the last I saw was on  
> [http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/](http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/)
> 
> There is also a ticket somewhere - I posted a comment to David Radcliffe's  
> blog with a reference, but my comment has not materialized yet!
> 
> Best, Martin
> 
> On Wed, Nov 12, 2014 at 11:49 AM, David A. Williams [dwilliams@daxko.com](mailto:dwilliams@daxko.com)  
> wrote:
> 
> > Hello All,
> > 
> > I’m using chruby and chefdk on my mac. I’ve added chefdk’s ruby to  
> > chruby so I can switch to it easily. This works great except for the  
> > requirement to have /opt/chedk/bin before /opt/chefdk/embedded/bin in the  
> > file path since chruby puts all the ruby paths first. I was wondering if  
> > anyone had the same setup and what they used to work around it.
> > 
> > Thanks,
> > 
> > David
> > 
> > * * *
> > 
> > CONFIDENTIALITY NOTICE: This electronic mail may contain information that  
> > is privileged, confidential, and/or otherwise protected from disclosure to  
> > anyone other than its intended recipient(s). Any dissemination or use of  
> > this electronic mail or its contents by persons other than the intended  
> > recipient(s) is strictly prohibited. If you have received this  
> > communication in error, please notify the sender immediately by reply  
> > e-mail so that we may correct our internal records. Please then delete the  
> > original message. Thank you.

---

<div class="post-metadata">

**Author:** ![David\_A\_Williams](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/david_a_williams/32/209_2.png) [@David\_A\_Williams](https://discourse.chef.io/u/David_A_Williams)\
**Post date:** [November 19, 2014, 1:49pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925/4 "2014-11-19T13:49:33Z")

</div>

I ended up hacking shrub’s auto function. Not great but it will work for now.

David Williams  
From: Booker Bense \<[bbense@gmail.com](mailto:bbense@gmail.com)[mailto:bbense@gmail.com](mailto:bbense@gmail.com)\>  
Reply-To: "chef@lists.opscode.com[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com)[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)\>  
Date: Tuesday, November 18, 2014 at 9:23 AM  
To: "chef@lists.opscode.com[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com)[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)\>  
Subject: [chef] Re: Re: chefdk and chruby

Direnv might be a better solution to this problem than chruby.

[http://direnv.net](http://direnv.net)

On Sun, Nov 16, 2014 at 3:47 PM, Martin Cleaver \<[mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)[mailto:mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)\> wrote:  
I had some issues, David, with gem executables.

See [https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html](https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html)

I’d be interested in official advice - the last I saw was on [http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/](http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/)

There is also a ticket somewhere - I posted a comment to David Radcliffe’s blog with a reference, but my comment has not materialized yet!

Best, Martin

On Wed, Nov 12, 2014 at 11:49 AM, David A. Williams \<[dwilliams@daxko.com](mailto:dwilliams@daxko.com)[mailto:dwilliams@daxko.com](mailto:dwilliams@daxko.com)\> wrote:  
Hello All,

I’m using chruby and chefdk on my mac. I’ve added chefdk’s ruby to chruby so I can switch to it easily. This works great except for the requirement to have /opt/chedk/bin before /opt/chefdk/embedded/bin in the file path since chruby puts all the ruby paths first. I was wondering if anyone had the same setup and what they used to work around it.

Thanks,

David

* * *

CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.

* * *

CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.

---

<div class="post-metadata">

**Author:** ![Martin\_Cleaver](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Martin\_Cleaver](https://discourse.chef.io/u/Martin_Cleaver)\
**Post date:** [November 20, 2014, 3:33pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925/5 "2014-11-20T15:33:17Z")

</div>

Can you share your approach please? Thanks, M.

On Wed, Nov 19, 2014 at 8:49 AM, David A. Williams [dwilliams@daxko.com](mailto:dwilliams@daxko.com)  
wrote:

> I ended up hacking shrub’s auto function. Not great but it will work  
> for now.
> 
> _David Williams_  
> From: Booker Bense [bbense@gmail.com](mailto:bbense@gmail.com)  
> Reply-To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com)" [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Date: Tuesday, November 18, 2014 at 9:23 AM  
> To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com)" [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Re: Re: chefdk and chruby
> 
> Direnv might be a better solution to this problem than chruby.
> 
> [http://direnv.net](http://direnv.net)
> 
> On Sun, Nov 16, 2014 at 3:47 PM, Martin Cleaver [mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)  
> wrote:
> 
> > I had some issues, David, with gem executables.
> > 
> > See [Using Chef DK alongside rbenv](https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html)
> > 
> > I'd be interested in official advice - the last I saw was on  
> > [http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/](http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/)
> > 
> > There is also a ticket somewhere - I posted a comment to David  
> > Radcliffe's blog with a reference, but my comment has not materialized yet!
> > 
> > Best, Martin
> > 
> > On Wed, Nov 12, 2014 at 11:49 AM, David A. Williams [dwilliams@daxko.com](mailto:dwilliams@daxko.com)  
> > wrote:
> > 
> > > Hello All,
> > > 
> > > I’m using chruby and chefdk on my mac. I’ve added chefdk’s ruby to  
> > > chruby so I can switch to it easily. This works great except for the  
> > > requirement to have /opt/chedk/bin before /opt/chefdk/embedded/bin in the  
> > > file path since chruby puts all the ruby paths first. I was wondering if  
> > > anyone had the same setup and what they used to work around it.
> > > 
> > > Thanks,
> > > 
> > > David
> > > 
> > > * * *
> > > 
> > > CONFIDENTIALITY NOTICE: This electronic mail may contain information  
> > > that is privileged, confidential, and/or otherwise protected from  
> > > disclosure to anyone other than its intended recipient(s). Any  
> > > dissemination or use of this electronic mail or its contents by persons  
> > > other than the intended recipient(s) is strictly prohibited. If you have  
> > > received this communication in error, please notify the sender immediately  
> > > by reply e-mail so that we may correct our internal records. Please then  
> > > delete the original message. Thank you.
> 
> * * *
> 
> CONFIDENTIALITY NOTICE: This electronic mail may contain information that  
> is privileged, confidential, and/or otherwise protected from disclosure to  
> anyone other than its intended recipient(s). Any dissemination or use of  
> this electronic mail or its contents by persons other than the intended  
> recipient(s) is strictly prohibited. If you have received this  
> communication in error, please notify the sender immediately by reply  
> e-mail so that we may correct our internal records. Please then delete the  
> original message. Thank you.

---

<div class="post-metadata">

**Author:** ![David\_A\_Williams](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/david_a_williams/32/209_2.png) [@David\_A\_Williams](https://discourse.chef.io/u/David_A_Williams)\
**Post date:** [November 20, 2014, 4:02pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925/6 "2014-11-20T16:02:15Z")

</div>

Martin,

Here’s a gist [https://gist.github.com/dawilliams/1674b7d7744d95c1b781](https://gist.github.com/dawilliams/1674b7d7744d95c1b781)

I basically added the chefdk function and called it from chruby\_auto function. Look for “## Added” comments

Thanks,

David Williams

From: Martin Cleaver \<[mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)[mailto:mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)\>  
Reply-To: "chef@lists.opscode.com[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com)[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)\>  
Date: Thursday, November 20, 2014 at 9:33 AM  
To: "chef@lists.opscode.com[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com)[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)\>  
Subject: [chef] Re: Re: Re: Re: chefdk and chruby

Can you share your approach please? Thanks, M.

On Wed, Nov 19, 2014 at 8:49 AM, David A. Williams \<[dwilliams@daxko.com](mailto:dwilliams@daxko.com)[mailto:dwilliams@daxko.com](mailto:dwilliams@daxko.com)\> wrote:  
I ended up hacking shrub’s auto function. Not great but it will work for now.

David Williams  
From: Booker Bense \<[bbense@gmail.com](mailto:bbense@gmail.com)[mailto:bbense@gmail.com](mailto:bbense@gmail.com)\>  
Reply-To: "chef@lists.opscode.com[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com)[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)\>  
Date: Tuesday, November 18, 2014 at 9:23 AM  
To: "chef@lists.opscode.com[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com)[mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)\>  
Subject: [chef] Re: Re: chefdk and chruby

Direnv might be a better solution to this problem than chruby.

[http://direnv.net](http://direnv.net)

On Sun, Nov 16, 2014 at 3:47 PM, Martin Cleaver \<[mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)[mailto:mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)\> wrote:  
I had some issues, David, with gem executables.

See [https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html](https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html)

I’d be interested in official advice - the last I saw was on [http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/](http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/)

There is also a ticket somewhere - I posted a comment to David Radcliffe’s blog with a reference, but my comment has not materialized yet!

Best, Martin

On Wed, Nov 12, 2014 at 11:49 AM, David A. Williams \<[dwilliams@daxko.com](mailto:dwilliams@daxko.com)[mailto:dwilliams@daxko.com](mailto:dwilliams@daxko.com)\> wrote:  
Hello All,

I’m using chruby and chefdk on my mac. I’ve added chefdk’s ruby to chruby so I can switch to it easily. This works great except for the requirement to have /opt/chedk/bin before /opt/chefdk/embedded/bin in the file path since chruby puts all the ruby paths first. I was wondering if anyone had the same setup and what they used to work around it.

Thanks,

David

* * *

CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.

* * *

CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.

* * *

CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.

---

<div class="post-metadata">

**Author:** ![Martin\_Cleaver](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Martin\_Cleaver](https://discourse.chef.io/u/Martin_Cleaver)\
**Post date:** [November 20, 2014, 4:31pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925/7 "2014-11-20T16:31:18Z")

</div>

Thanks David,

So, Daniel has now posted my comment - leading back to

> <https://github.com/chef-boneyard/chef-dk/issues/16>
>
> As a long time user of Chef, I am finding that installing ChefDK a very scary pr…ospect. This may be due to some lack of documentation.
> \- How is this not going to cause the same pain and grief as when Vagrant when from Gems to package?
> \- How does this interact with normal \`bundle install\` in cookbooks, or other app development that might use gems that are associated with chef, berkshelf, etc.?
> \- How does it interact with (or break) rvm/rbenv workflows?
> 
> An indication of this confusion is that Berkshelf says to put \`/opt/chefdk/embedded/bin\` in your $PATH

I'll link that back to here.

On Thu, Nov 20, 2014 at 11:02 AM, David A. Williams [dwilliams@daxko.com](mailto:dwilliams@daxko.com)  
wrote:

> Martin,
> 
> Here’s a gist [https://gist.github.com/dawilliams/1674b7d7744d95c1b781](https://gist.github.com/dawilliams/1674b7d7744d95c1b781)
> 
> I basically added the chefdk function and called it from chruby\_auto  
> function. Look for "## Added" comments
> 
> Thanks,
> 
> _David Williams_
> 
> From: Martin Cleaver [mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)  
> Reply-To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com)" [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Date: Thursday, November 20, 2014 at 9:33 AM  
> To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com)" [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Re: Re: Re: Re: chefdk and chruby
> 
> Can you share your approach please? Thanks, M.
> 
> On Wed, Nov 19, 2014 at 8:49 AM, David A. Williams [dwilliams@daxko.com](mailto:dwilliams@daxko.com)  
> wrote:
> 
> > I ended up hacking shrub’s auto function. Not great but it will work  
> > for now.
> > 
> > _David Williams_  
> > From: Booker Bense [bbense@gmail.com](mailto:bbense@gmail.com)  
> > Reply-To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com)" [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> > Date: Tuesday, November 18, 2014 at 9:23 AM  
> > To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com)" [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> > Subject: [chef] Re: Re: chefdk and chruby
> > 
> > Direnv might be a better solution to this problem than chruby.
> > 
> > [http://direnv.net](http://direnv.net)
> > 
> > On Sun, Nov 16, 2014 at 3:47 PM, Martin Cleaver [mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com)  
> > wrote:
> > 
> > > I had some issues, David, with gem executables.
> > > 
> > > See [Using Chef DK alongside rbenv](https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html)
> > > 
> > > I'd be interested in official advice - the last I saw was on  
> > > [http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/](http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/)
> > > 
> > > There is also a ticket somewhere - I posted a comment to David  
> > > Radcliffe's blog with a reference, but my comment has not materialized yet!
> > > 
> > > Best, Martin
> > > 
> > > On Wed, Nov 12, 2014 at 11:49 AM, David A. Williams \<[dwilliams@daxko.com](mailto:dwilliams@daxko.com)
> > > 
> > > > wrote:
> > > 
> > > > Hello All,
> > > > 
> > > > I’m using chruby and chefdk on my mac. I’ve added chefdk’s ruby to  
> > > > chruby so I can switch to it easily. This works great except for the  
> > > > requirement to have /opt/chedk/bin before /opt/chefdk/embedded/bin in the  
> > > > file path since chruby puts all the ruby paths first. I was wondering if  
> > > > anyone had the same setup and what they used to work around it.
> > > > 
> > > > Thanks,
> > > > 
> > > > David
> > > > 
> > > > * * *
> > > > 
> > > > CONFIDENTIALITY NOTICE: This electronic mail may contain information  
> > > > that is privileged, confidential, and/or otherwise protected from  
> > > > disclosure to anyone other than its intended recipient(s). Any  
> > > > dissemination or use of this electronic mail or its contents by persons  
> > > > other than the intended recipient(s) is strictly prohibited. If you have  
> > > > received this communication in error, please notify the sender immediately  
> > > > by reply e-mail so that we may correct our internal records. Please then  
> > > > delete the original message. Thank you.
> > 
> > * * *
> > 
> > CONFIDENTIALITY NOTICE: This electronic mail may contain information that  
> > is privileged, confidential, and/or otherwise protected from disclosure to  
> > anyone other than its intended recipient(s). Any dissemination or use of  
> > this electronic mail or its contents by persons other than the intended  
> > recipient(s) is strictly prohibited. If you have received this  
> > communication in error, please notify the sender immediately by reply  
> > e-mail so that we may correct our internal records. Please then delete the  
> > original message. Thank you.
> 
> * * *
> 
> CONFIDENTIALITY NOTICE: This electronic mail may contain information that  
> is privileged, confidential, and/or otherwise protected from disclosure to  
> anyone other than its intended recipient(s). Any dissemination or use of  
> this electronic mail or its contents by persons other than the intended  
> recipient(s) is strictly prohibited. If you have received this  
> communication in error, please notify the sender immediately by reply  
> e-mail so that we may correct our internal records. Please then delete the  
> original message. Thank you.

---

<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:** [November 20, 2014, 4:52pm UTC](https://discourse.chef.io/t/chefdk-and-chruby/5925/8 "2014-11-20T16:52:25Z")

</div>

Can you just run `eval "$(chef shell-init SHELL_NAME)”` in your shell to enable ChefDK for your current session? Are there things that don’t work if you do that?

I use rbenv for development but run the above to test ChefDK and haven’t had any trouble.

--  
Daniel DeLeo

On Thursday, November 20, 2014 at 8:31 AM, Martin Cleaver wrote:

> Thanks David,
> 
> So, Daniel has now posted my comment - leading back to [How does ChefDK interoperate (or break) normal ruby gem workflows? · Issue #16 · chef-boneyard/chef-dk · GitHub](https://github.com/opscode/chef-dk/issues/16)
> 
> I'll link that back to here.
> 
> On Thu, Nov 20, 2014 at 11:02 AM, David A. Williams \<[dwilliams@daxko.com](mailto:dwilliams@daxko.com) ([mailto:dwilliams@daxko.com](mailto:dwilliams@daxko.com))\> wrote:
> 
> > Martin,
> > 
> > Here’s a gist [https://gist.github.com/dawilliams/1674b7d7744d95c1b781](https://gist.github.com/dawilliams/1674b7d7744d95c1b781)
> > 
> > I basically added the chefdk function and called it from chruby\_auto function. Look for "## Added" comments
> > 
> > Thanks,
> > 
> > David Williams
> > 
> > From: Martin Cleaver \<[mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com) ([mailto:mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com))\>  
> > Reply-To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com) ([mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com))" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com) ([mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com))\>  
> > Date: Thursday, November 20, 2014 at 9:33 AM  
> > To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com) ([mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com))" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com) ([mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com))\>  
> > Subject: [chef] Re: Re: Re: Re: chefdk and chruby
> > 
> > Can you share your approach please? Thanks, M.
> > 
> > On Wed, Nov 19, 2014 at 8:49 AM, David A. Williams \<[dwilliams@daxko.com](mailto:dwilliams@daxko.com) ([mailto:dwilliams@daxko.com](mailto:dwilliams@daxko.com))\> wrote:
> > 
> > > I ended up hacking shrub’s auto function. Not great but it will work for now.
> > > 
> > > David Williams  
> > > From: Booker Bense \<[bbense@gmail.com](mailto:bbense@gmail.com) ([mailto:bbense@gmail.com](mailto:bbense@gmail.com))\>  
> > > Reply-To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com) ([mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com))" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com) ([mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com))\>  
> > > Date: Tuesday, November 18, 2014 at 9:23 AM  
> > > To: "[chef@lists.opscode.com](mailto:chef@lists.opscode.com) ([mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com))" \<[chef@lists.opscode.com](mailto:chef@lists.opscode.com) ([mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com))\>  
> > > Subject: [chef] Re: Re: chefdk and chruby
> > > 
> > > Direnv might be a better solution to this problem than chruby.
> > > 
> > > [http://direnv.net](http://direnv.net)
> > > 
> > > On Sun, Nov 16, 2014 at 3:47 PM, Martin Cleaver \<[mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com) ([mailto:mrjcleaver2@gmail.com](mailto:mrjcleaver2@gmail.com))\> wrote:
> > > 
> > > > I had some issues, David, with gem executables.
> > > > 
> > > > See [Using Chef DK alongside rbenv](https://dwradcliffe.com/2014/09/19/chefdk-with-rbenv.html)
> > > > 
> > > > I'd be interested in official advice - the last I saw was on [http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/](http://jtimberman.housepub.org/blog/2014/04/30/chefdk-and-ruby/)
> > > > 
> > > > There is also a ticket somewhere - I posted a comment to David Radcliffe's blog with a reference, but my comment has not materialized yet!
> > > > 
> > > > Best, Martin
> > > > 
> > > > On Wed, Nov 12, 2014 at 11:49 AM, David A. Williams \<[dwilliams@daxko.com](mailto:dwilliams@daxko.com) ([mailto:dwilliams@daxko.com](mailto:dwilliams@daxko.com))\> wrote:
> > > > 
> > > > > Hello All,
> > > > > 
> > > > > I’m using chruby and chefdk on my mac. I’ve added chefdk’s ruby to chruby so I can switch to it easily. This works great except for the requirement to have /opt/chedk/bin before /opt/chefdk/embedded/bin in the file path since chruby puts all the ruby paths first. I was wondering if anyone had the same setup and what they used to work around it.
> > > > > 
> > > > > Thanks,
> > > > > 
> > > > > David  
> > > > > CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.
> > > 
> > > CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.
> > 
> > CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.
