Closed spuder closed 9 years ago
Turns out this was an environment issue. While the chefdk was installed, the berks gem was also installed.
I fixed this by moving the following to the front of my path
PATH=/opt/chefdk/bin:$PATH
Now which berks
points to the right location.
which berks
/Users/sowen/.rvm/gems/ruby-2.2.0/bin/berks
which berks
/opt/chefdk/bin/berks
Hello, I spend some time and i found this solution : vagrant plugin install vagrant-berkshelf --plugin-version 2.0.1 --verbose
Downgrading to an earlier version of the plugin does not "fix" the issue - you are going to have more problems with older versions of vagrant-berkshelf than just installing the ChefDK and ensuring it is in your $PATH.
So, I restart the installation and try to follow your instructions. I am blocked by this message :
vagrant plugin install vagrant-berkshelf Installing the 'vagrant-berkshelf' plugin. This can take a few minutes... Installed the plugin 'vagrant-berkshelf (4.0.3)'! Post install message from the 'vagrant-berkshelf' plugin: The Vagrant Berkshelf plugin requires Berkshelf from the Chef Development Kit. You can download the latest version of the Chef Development Kit from: https://downloads.getchef.com/chef-dk Installing Berkshelf via other methods is not officially supported.
and I put this PATH in my .bashprofile : export PATH=/opt/chefdk/bin:$PATH The PATH is good when i do a echo $PATH :
$ echo $PATH /opt/chefdk/bin:/usr/local/php5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
If you have an idea it's could be very nice. Thank you
what does the output of the following command show?
$ which berks
Thank you to reply me. This command show :
/opt/chefdk/bin/berks
just as a follow up:
installation:
vagrant --version
Vagrant 1.7.1
which berks
/opt/chefdk/bin/berks
chef --version
Chef Development Kit Version: 0.6.0
chef-client version: 12.3.0
berks version: 3.2.4
kitchen version: 1.4.0
error on 'vagrant up'
==> ****-*****: Successfully added box 'chef/ubuntu-14.04' (v1.0.0) for 'virtualbox'!
The following berks command failed to execute:
/opt/chefdk/bin/berks --version --format json
The stdout and stderr are shown below:
stdout:
stderr: /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'berkshelf' (>= 0) among 82 total gem(s) (Gem::LoadError)
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /opt/chefdk/bin/berks:22:in `<main>
on installation of the vagrant-berkshelf plugin i get a warning that chefdk is not in the path - which is not true.
it looks like that /opt/chefdk/bin/berks gets executed out of the vagrant embedded gemrc and vagrant tries then to load the gems from his embedded gems - which obviously is not there.
Any solution for this issue?
I'm with the same problem here.
$ vagrant -v Vagrant 1.8.1
$ chef -v Chef Development Kit Version: 0.10.0 chef-client version: 12.5.1 berks version: 4.0.1 kitchen version: 1.4.2
$ echo $PATH /opt/chefdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
$ which berks /opt/chefdk/bin/berks
$ vagrant plugin install vagrant-berkshelf [sudo] password for diegojonio: Installing the 'vagrant-berkshelf' plugin. This can take a few minutes... Installed the plugin 'vagrant-berkshelf (4.1.0)'! Post install message from the 'vagrant-berkshelf' plugin:
The Vagrant Berkshelf plugin requires Berkshelf from the Chef Development Kit. You can download the latest version of the Chef Development Kit from:
https://downloads.chef.io/chef-dk/
Installing Berkshelf via other methods is not officially supported.
Turns out this was an environment issue. While the chefdk was installed, the berks gem was also installed.
I fixed this by moving the following to the front of my path
PATH=/opt/chefdk/bin:$PATH
Now which berks points to the right location.
which berks
/Users/sowen/.rvm/gems/ruby-2.2.0/bin/berks
which berks
/opt/chefdk/bin/berks
thanks really this worked for me, just right now I have to do it everyday because after restarting pc the path is changed to /Users/Matoosh/.rbenv/shims/berks what do you think about doing that automatically?
When installing the latest version of vagrant (1.7.2) , and the latest version of chef-dk (4.0.0), vagrant-berkshelf crashes and claims that the chef-dk is not installed.