Undefined method 'wsl'

Ever since Trellis pull request #935 was merged I get the following error when trying to vagrant up a new Trellis site. Reverting the commit fixes the problem. I’m on Windows 10 and not using WSL. Anyone else having this problem?

D:/sites/site.com/trellis/Vagrantfile:72:in `block in <top (required)>': undefined method `wsl?' for Vagrant::Util::Platform:Class (NoMethodError)
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/v2/loader.rb:37:in `call'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/v2/loader.rb:37:in `load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:107:in `each'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:107:in `block in load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:104:in `each'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:104:in `load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/vagrantfile.rb:28:in `initialize'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:746:in `new'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:746:in `vagrantfile'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:492:in `host'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:214:in `block in action_runner'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/action/runner.rb:33:in `call'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/action/runner.rb:33:in `run'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:479:in `hook'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:728:in `unload'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/bin/vagrant:130:in `ensure in <main>'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/bin/vagrant:130:in `<main>'
1 Like

This should be resolved by updating to the newest version of Vagrant. I can confirm that it functions in Vagrant 2.0.1.

Alternatively, reverting that commit won’t have any negative effect on your development, etc, if you aren’t using WSL: All it does it prevent Vagrant from attempting to use NFS when run (as a Linux executable) from inside WSL, since there’s no NFS support there.

2 Likes

Thanks @alwaysblank, I’ll try that. Perhaps a note should be added to the Windows docs, since Trellis docs list Vagrant >= 1.8.5.

1 Like

I’m hoping to write a small addendum to the Trellis on windows docs relating specifically to WSL, so I’ll try and get a note about that in there.

1 Like

Oh we should definitely bump the requirement then. Both in the README and in Vagrantfile:

Vagrant.require_version '>= 1.8.5'

@alwaysblank want to do a PR for that?

Yeah, I’ll try and get that out tonight.

1 Like

Upgrading Vagrant worked. Thanks for that, and for updating the docs.

1 Like