Vagrant: Vagrant will show many warning for any commands

Created on 14 Jul 2017  ·  9Comments  ·  Source: hashicorp/vagrant

Vagrant version

vagrant 1.9.7 64 bits

Host operating system

Windows 10 64 bits Professional

Guest operating system

N/A

Vagrantfile

N/A

Debug output

I run "vagrant box list", then I find the following output

C:/Users/huifshen/scoop/apps/vagrant/1.9.7/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/shared_helpers.rb:13: warning: already initialized constant Vagrant::DEFAULT_SERVER_URL
C:/Users/huifshen/scoop/apps/vagrant/current/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/shared_helpers.rb:13: warning: previous definition of DEFAULT_SERVER_URL was here
C:/Users/huifshen/scoop/apps/vagrant/1.9.7/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/shared_helpers.rb:19: warning: already initialized constant Vagrant::THREAD_MAX_JOIN_TIMEOUT
C:/Users/huifshen/scoop/apps/vagrant/current/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/shared_helpers.rb:19: warning: previous definition of THREAD_MAX_JOIN_TIMEOUT was here
C:/Users/huifshen/scoop/apps/vagrant/1.9.7/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/version.rb:5: warning: already initialized constant Vagrant::VERSION
C:/Users/huifshen/scoop/apps/vagrant/current/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/version.rb:5: warning: previous definition of VERSION was here
C:/Users/huifshen/scoop/apps/vagrant/current/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/bundler.rb:23: warning: already initialized constant Vagrant::Bundler::HASHICORP_GEMSTORE
C:/Users/huifshen/scoop/apps/vagrant/1.9.7/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/bundler.rb:23: warning: previous definition of HASHICORP_GEMSTORE was here
C:/Users/huifshen/scoop/apps/vagrant/current/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/bundler.rb:26: warning: already initialized constant Vagrant::Bundler::DEFAULT_GEM_SOURCES
C:/Users/huifshen/scoop/apps/vagrant/1.9.7/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/bundler.rb:26: warning: previous definition of DEFAULT_GEM_SOURCES was here
There are no installed boxes! Use `vagrant box add` to add some.

I try to search the registry and check my environment setting, there is no such variable definition VAGRANT_SERVER_URL.

I meet this problem when I upgrade from vagrant 1.9.5

Expected behavior

No such warnning

Actual behavior

Steps to reproduce

References

All 9 comments

You can close this issue, because I use scoop to install vagrant. I uninstall vagrant via scoop and install it by click msi file. This time, there's no such warning.

But I uninstall vagrant in control panel and install it via scoop. I meet the same problem.

I will appreciate if you can tell me why such warning. I still want to use scoop.

My uninformed guess is it is caused by how vagrant is being loaded which seems to be different than a regular Vagrant installation.

Cheers!

Correct. After switching the PATH entry for vagrant to correct location, this message does not appear anymore. I've symlinked the folder on Windows and installed update in symlink instead of original location. Vagrant installer updates PATH entry.

Would you please give your workaround detailed so that I can follow it.

Vagrant team can take a look and fix it.

Scoop has its own shim management. I've also used it, but I'm not that much convinced and had more troubles than benefits.

So when you've just used Scoop I guess there is a problem with its Shim management. Because Scoop installs Vagrant in something like ~/scoop/apps/vagrant/1.9.11/bin/vagrant.exe but the shim points to ~/scoop/apps/vagrant/current/bin/vagrant.exe

I suggest to simply not use Scoop. Uninstall vagrant and reinstall it using the installer.

Or open an issue in Scoop's issue tracker on Github. They've got many issues with installation scripts and stuff like that. The main reason why I'm using manual installers again.

Hope this helps :)

Thanks a lot for this. That's no problem when install some software manual.

I use scoop because I can maintain my favorite tool in my own bucket.

Today, vagrant update 2.0.0. I decide to do some try. Then I find a workaround

I modify the %userprofile%scoopshimvagrant.shim to

path = C:\Users\huifshen\scoop\apps\vagrant\2.0.0\bin\vagrant.exe

and the %userprofile%scoopshimvagrant.ps1

$path = join-path "$psscriptroot" "..\apps\vagrant\2.0.0\bin\vagrant.exe"
if($myinvocation.expectingInput) { $input | & $path @args } else { & $path @args }

The change is modify current to real installed directory. And there is no warning any more. I think it's a vagrant issue and it can not handle link folder. I always use readlink -f to handle the soft link on Linux.

Uhh, a new major version! It is installing... and this time in the correct destination ;-)

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings