Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

Berkshelf version at "/usr/bin/berks" is invalid. #272

Closed
LevonBecker opened this issue Mar 14, 2015 · 11 comments
Closed

Berkshelf version at "/usr/bin/berks" is invalid. #272

LevonBecker opened this issue Mar 14, 2015 · 11 comments

Comments

@LevonBecker
Copy link

I can't seem to get vagrant berkshelf plugin to work. I'm hoping it just something simple I'm missing and I can get a quick fix.

Versions

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
Vagrant 1.7.2
VirtualBox 4.3.24
ChefDK 0.4.0-1
vagrant-berkshelf (4.0.3)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.3, system)

berks -v

#<Proc:0x000000029b5c88@/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.2/lib/ridley/chef/config.rb:50 (lambda)>
3.2.3

Ruby

I use RVM and running 2.1.5. I removed RVM completely and get the same error. I even installed Ubuntu base ruby2.0.

Vagrant up Error

The Berkshelf version at "/usr/bin/berks" is invalid.
Vagrant Berkshelf requires ~> 3.2, but the current version is .

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.

Vagrantfile

VAGRANTFILE_API_VERSION = '2'

Vagrant.require_version '>= 1.5.0'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  vmhostname = 'hello-world'
  config.vm.hostname = vmhostname

  if Vagrant.has_plugin?('vagrant-omnibus')
    config.omnibus.chef_version = 'latest'
  end
  config.vm.box = 'opscode_centos-6.6'
  config.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.6_chef-provisionerless.box'
  config.vm.network :private_network, type: 'dhcp'
  config.vm.network :forwarded_port, guest: 80, host: 8000
  config.vm.provider :virtualbox do |vb|
    vb.customize ['modifyvm', :id, '--name', vmhostname]
    vb.customize ['modifyvm', :id, '--memory', '1024']
  end
  config.berkshelf.enabled = true
  config.vm.provision :chef_solo do |chef|
    chef.json = {
    }

    chef.run_list = [
      'recipe[hello_world::default]'
    ]
  end
end

Troubleshooting

which berks
/usr/bin/berks

The ChefDK binaries are in the path.

@sethvargo
Copy link
Contributor

What is the output of

$ /usr/bin/berks -v

@LevonBecker
Copy link
Author

# /usr/bin/berks -v
#<Proc:0x00000001ecb070@/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.2/lib/ridley/chef/config.rb:50 (lambda)>
3.2.3

@LevonBecker
Copy link
Author

I'm actually digging into Kitchen to see if I can make it do what I do with Vagrant... Multi-VM Full stack in wrapper cookbook with multiple roles etc. Instana work with my shared_vagrant project if get these working, but probably good to get up to speed on Kitchen too. So win either way. Thanks for the help. I just keep wondering if the comment that is output every time I use a ChefDK binary is causing the version verification to fail with vagrant-berkshelf.

@sethvargo
Copy link
Contributor

That comment is strange. Can you try purging chefdk?

@LevonBecker
Copy link
Author

lol I'm tired. I removed and reinstalled. I even tried a couple older versions. Anything special when nuking it I could have missed? I"m guessing it works fine for you on Ubuntu 14.04 with all the latest / versions I listed?

@sethvargo
Copy link
Contributor

@LevonBecker I run OS X, so I don't know. Make sure you are removing everything in /opt/chefdk and ~/.chefdk.

@hychen
Copy link

hychen commented Apr 8, 2015

+1 has same issue on OS X 11.10.

I've tried purge chefsdk and vagrant, but still has same problem.

additional information

hychen@mluna:~|⇒  /usr/bin/berks -v
3.2.3

@pgoddardmiles
Copy link

I had similar problem. I was able to download and install Chef DK from https://downloads.chef.io/chef-dk/mac/#/ Installed and was able to vagrant up.
Hope that helps anyone.
OS X 10.10.2

@dkinzer
Copy link

dkinzer commented May 7, 2015

Make sure you set up your path such that the binary that get's called first is the berks in the chefdk location: That is, which berks should return /opt/chefdk/bin/berks

@mmell
Copy link

mmell commented Oct 22, 2015

Did you try vagrant plugin update?

@reset
Copy link
Contributor

reset commented Oct 23, 2015

@mmell is correct, you'll need to install a newer version of the ChefDK and update your plugin to match

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

No branches or pull requests

7 participants