Vagrant: Unknown configuration section 'omnibu

2019-06-25 00:23发布

问题:

I've followed the instructions at: http://berkshelf.com/ after installing the latest ChefDK (from here: http://downloads.getchef.com/chef-dk/mac/#/). When I do "vagrant up", I get the error:

Vagrant:
* Unknown configuration section 'omnibus'.

Various posts (e.g. Vagrant Install chef-client on top of base image) have suggested this means that the vagrant-omnibus plugin is not installed. In my case, I have installed it. "vagrant plugin list" displays:

vagrant-berkshelf (2.0.1)
  - Version Constraint: 2.0.1
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.1, system)

Any suggestions as to how I can get this example cookbook to run on a new VM instance launched with "vagrant up"?

回答1:

It turns out the issue for me was that while ~/.vagrant.d/plugins.json included the vagrant-omnibus plugin, the ~/.vagrant.d/gems/gems and ~/.vagrant.d/gems/specifications directories did not contain the appropriate GEM or gemspec files. Not sure how this happened, but I suspect it was due to accidentally typing ^C in the middle of execution of the vagrant plugin install command and then reexecuting that command.

It would appear vagrant plugin install does not do appropriate ^C handling and that it writes the contents of plugins.json before it has stored the gem and gemspec.

Subsequent vagrant plugin install commands don't fix the problem. Manually editing plugins.json to remove the plugin and then reexecuting the vagrant plugin install vagrant-omnibus command fixed the issue.



回答2:

I personally went inside the vagrant file using VI editor and commented out the line that has omni bus script and then run " vagrant status" and then "vagrant up"

1.vi Vagrant 2.?omnibus 3."insert" I omnibus 4.insert # to comment out the line 5. wq! to come out of vi editor

** this issue can also be related with the type of OS one is using ,i am using a mac