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

Vagrant: Undefined method 'provider' #298

Closed
mausch opened this issue Feb 11, 2015 · 3 comments
Closed

Vagrant: Undefined method 'provider' #298

mausch opened this issue Feb 11, 2015 · 3 comments

Comments

@mausch
Copy link

mausch commented Feb 11, 2015

Using Vagrant 1.7.2 on Windows 8 x64, when I run vagrant up I get this error:

[Vagrant   ] 1.7.2
c:/oss/cookbook-elasticsearch/Vagrantfile:183:in `block (3 levels) in <top (required)>': undefined method `provider' for #<VagrantPlugins::Kernel_V1::VMConfig:0x33d0140> (NoMethodError)
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v1/loader.rb:37:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v1/loader.rb:37:in `load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:103:in `block (2 levels) in load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:97:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:97:in `block in load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:94:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:94:in `load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:149:in `machine_config'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:325:in `default_provider'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:165:in `block in with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:192:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:192:in `block in with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:174:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:174:in `with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/up/command.rb:74:in `block in execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:277:in `block (2 levels) in batch'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:275:in `tap'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:275:in `block in batch'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:274:in `synchronize'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:274:in `batch'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/up/command.rb:58:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/cli.rb:42:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:301:in `cli'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/bin/vagrant:174:in `<main>'

According to hashicorp/vagrant#1477 apparently this means that the config version is wrong?

@mausch mausch changed the title Undefined method 'provider' Vagrant: Undefined method 'provider' Feb 11, 2015
@mausch
Copy link
Author

mausch commented Feb 11, 2015

I changed https://github.com/elasticsearch/cookbook-elasticsearch/blob/master/Vagrantfile#L155 to:

Vagrant.configure(2) do |config|

and it worked (or rather, I'm getting a different error now).
I'm just getting started with all this so I don't fully understand the consequences of making this change, would it break anything for other people?

@skidamien
Copy link

It's the config version mentioned here:
http://docs.vagrantup.com/v2/vagrantfile/version.html

VAGRANTFILE_CONFIG_VERSION = "2"
Vagrant.configure(VAGRANTFILE_CONFIG_VERSION) do |config|
#Vagrant::Config.run do |config|

Also, your other issue can be solved by adding:

I18n.enforce_available_locales = false

@martinb3
Copy link
Contributor

martinb3 commented Jul 6, 2015

Hi there -- we've re-written the cookbook and now completely support test-kitchen for testing, which has a Vagrant driver that should be working. Please give that a try.

@martinb3 martinb3 closed this as completed Jul 6, 2015
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