Message: GetoptLong::InvalidOption: unrecognized option `--prune'

Hi all,

I’m getting this error:

/opt/vagrant/embedded/gems/gems/vagrant-2.2.9/bin/vagrant: unrecognized option `--prune'
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/user/ansible/my_vagrant_project/Vagrantfile
Line number: 0
Message: GetoptLong::InvalidOption: unrecognized option `--prune'

when I run:

$ vagrant global-status --prune

Before that, I removed a VirtulalBox VM manually with:
$ rm -rf <VM>/*
and then removed it in VirtualBox.

How can I fix it? Or is it a bug?

Hi there,

Sorry that you’re seeing this error. I noticed that the path mentioned in the error message looks a little unusual:

/opt/vagrant/embedded/gems/gems/vagrant-2.2.9/bin/vagrant

instead of:

/opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/bin/vagrant

Would you mind uninstalling/reinstalling Vagrant to see if that fixes the issue?

Thanks for the response!

Vagrant is installed via pacman package manager (Arch Linux) and generally works fine.

I did, but it didn’t help.

I think, I have to remove all project related VMs manually.