Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef Zero Fails to Start - Multiple Gem Paths #10

Closed
harlanbarnes opened this issue Jul 3, 2013 · 2 comments
Closed

Chef Zero Fails to Start - Multiple Gem Paths #10

harlanbarnes opened this issue Jul 3, 2013 · 2 comments

Comments

@harlanbarnes
Copy link

Pretty simple setup for my first pass at using chef-zero ...

[harlan@clay zabbix]$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'CentOS-6.4-x86_64-Minimal'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[Chef Zero] Starting Chef Zero at http://10.20.55.149:4000
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start
[Chef Zero] Waiting for Chef Zero to start`

And it never starts ...

I poked around some and it seems like this line in lib/vagrant-chef-zero/server_helpers.rb seems like it expects to find only one directory:

vagrant_gems = ENV['GEM_PATH'].split(':').select { |gp| gp.include?('vagrant')}

but (at least on my system it finds two):

/home/harlan/.vagrant.d/gems
/opt/vagrant/bin/../embedded/gems

So then the next line joins the two together and adds the bin/chef-zero:

chef_zero_binary = ::File.join(vagrant_gems, "bin", "chef-zero")

to form this:

/home/harlan/.vagrant.d/gems/opt/vagrant/bin/../embedded/gems/bin/chef-zero

which obviously fails.

To work around this problem I just added a '.d' to the include and got it to start:

vagrant_gems = ENV['GEM_PATH'].split(':').select { |gp| gp.include?('vagrant.d')}

I have no idea if that's a good idea or not. :-)

Here's my setup if it matters:

[harlan@clay ~]$ lsb_release -d
Description:    Ubuntu 12.04.2 LTS
[harlan@clay ~]$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
[harlan@clay ~]$ vagrant -v
Vagrant version 1.2.2
[harlan@clay ~]$ vagrant plugin list
buff-config (0.2.0)
vagrant-berkshelf (1.3.2)
vagrant-chef-zero (0.2.4)
vagrant-omnibus (1.1.0)
@andrewgross
Copy link
Contributor

Sorry for the delay in getting to this. Fixed in f87518e and released in 0.2.10

@jgoldschrafe
Copy link

Now this is broken for people who have vagrant-chef-zero installed through Bindler, since their chef-zero path is something more like ${COOKBOOK_DIR}/.vagrant/gems/bin/chef-zero. I'm sending a PR your way momentarily that looks for the chef-zero binary in a somewhat saner way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants