Skip to content
This repository was archived by the owner on Jul 14, 2021. It is now read-only.

chefdk preventing vagrant from working #466

Closed
trekr5 opened this issue Aug 13, 2015 · 5 comments
Closed

chefdk preventing vagrant from working #466

trekr5 opened this issue Aug 13, 2015 · 5 comments

Comments

@trekr5
Copy link

trekr5 commented Aug 13, 2015

Hi,

Hoping someone can help.

I'm trying to get a vagrant box to run on my windows computer. My environment has the latest version of ChefDK(0.6.2), berkshelf, ruby 1.9.3 and vagrant.

i have reinstalled Chefdk (version 0.6.2) a number of times and ensured that ChefDK (C:\opscode\chefdk\bin) is installed at the front of the PATH.

However each time when I type in vagrant up, I get the following error...

Bringing machine 'default' up with 'virtualbox' provider...
The following berks command failed to execute:

C:\Ruby193\bin/berks.BAT --version --format json

    The stdout and stderr are shown below:

    stdout:
    stderr: C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': 

Could   not find berkshelf (>= 0) amongst [akami-1.3.1, akami-1.3.0, builder-3.2.2, bundler-
1.10.5, celluloid-0.17.1.1, celluloid-0.17.0, celluloid-essentials-0.20.2,  celluloid-essentials- 
0.20.1.1, celluloid-extras-0.20.0, celluloid-fsm-0.20.0, celluloid-pool-0.20.0, cell
uloid-supervision-0.20.1, celluloid-supervision-0.20.0... (Gem::LoadError)

 from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
 from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
  from C:/Ruby193/bin/berks:22:in `<main>'

It appears that you are not using the ChefDK. Please note that Vagrant Berkshelf
works best when used with the ChefDK, and other installation methods are not
   officially supported.

Please download and install the latest version of the ChefDK from:

https://downloads.chef.io/chef-dk

and follow the installation instructions. Do not forget to add the ChefDK to
your PATH.

Can you please tell me how to solve this problem?

@trekr5
Copy link
Author

trekr5 commented Aug 13, 2015

Hello,

Hope this helps anyone with the same problem.

You will need to make sure that you have installed ChefDK on your machine and that chefdk appears at the beginning of your PATH %HOME%.chefdk\gem\ruby\2.0.0\bin:\opt\chefdk\bin

Found a fix whereby you'll have to remove the following gems from your computer, ensuring that you are in the cookbook that you are attempting to run on your VM:-

gem uninstall chef chef-zero berkshelf knife-solo

This makes certain that you are using the components only installed with ChefDK

@adamedx
Copy link

adamedx commented Aug 13, 2015

@trekr5 your posts are a little confusing since the first post shows Windows style paths and the second shows Unix paths.

If the issue really was that your ChefDK workstation had incorrect paths, you can use the command below in your shell before you start using ChefDK / doing anything chef-related:

chef shell init

and execute the resulting script. If you are using ChefDK from a Windows system using PowerShell, you would do the following:

chef shell init powershell | iex

We're working on a change to make this more obvious on Windows by providing a shortcut on the Start Menu.

@trekr5
Copy link
Author

trekr5 commented Aug 13, 2015

Hi,

Apologies.

What I should have written was %HOME%chefdk\gem\ruby\2.0.0\bin:\opt\chefdk\bin ! Amended it.

Thanks for the tip.

@adamedx
Copy link

adamedx commented Aug 13, 2015

Thanks for clarifying @trekr5 😄.

@danielsdeleo
Copy link
Contributor

ChefDK 0.8 has the shortcut. Unfortunately there isn't much more we can do to enforce working paths.

ksubrama pushed a commit that referenced this issue Jan 11, 2016
ChefDK#456: Fix ChefDK installation on OS X El Capitan
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants