Stubbs / sublime-vagrant

Vagrant commands for Sublime Text
43 stars 4 forks source link

Does not work on Windows #1

Closed MOZGIII closed 11 years ago

MOZGIII commented 11 years ago

On Windows there is no /usr/bin/vagrant. There should be a way to specify an executable via settings.

Stubbs commented 11 years ago

Can you tell me the default install path for Windows? I'll include it as an example in the config when I add it.

MOZGIII commented 11 years ago

There is no default install path for Windows, however, I believe you can simple run vagrant executable without specifying path. Vagrant will very likely be in PATH, so if sublime does not mess up with the system environment everything should work. To my mind, the same approach should be applied in linux and mac versions: for example, in linux I use RVM for ruby versions management, so I neither have a /usr/bin/vagrant in a linux setup. Really it will be something like /home/user/.rvm/gems/ruby-1.9.2-p180/bin/vagrant, but it depends on lots of things. So I think that usage of just execuable's name to make use of system environment is the right thing to do here for all platforms.

aaronjbaptiste commented 10 years ago

Does anyone know what kind of path this is expecting? I've tried:

"C:\HashiCorp\Vagrant\bin\vagrant.bat"
"C:\\HashiCorp\\Vagrant\\bin\\vagrant.bat"
"C:/HashiCorp/Vagrant/bin/vagrant.bat"
"/c/HashiCorp/Vagrant/bin/vagrant.bat"
"C:\HashiCorp\Vagrant\bin\vagrant"
"C:\\HashiCorp\\Vagrant\\bin\\vagrant"
"C:/HashiCorp/Vagrant/bin/vagrant"
"/c/HashiCorp/Vagrant/bin/vagrant"

I get the option for VagrantInit (which doesn't seem to do anything) and nothing else. I'm using Sublime Text 3 on Windows 7. Any ideas?

Stubbs commented 10 years ago

I think this is related to issue #9, so can you try what I have suggested on that ticket & reply over there? If nothing else you'll benefit from the extra debug I added and we can use that to fix the problem.

aaronjbaptiste commented 10 years ago

Cheers Stubbs. The latest version now gives me the other options. However I get this error when running Vagrant Start or Vagrant Provision:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "Vagrant in C:\Users\Aaron\AppData\Roaming\Sublime Text 3\Installed Packages\Vagrant.sublime-package", line 274, in run
  File "Vagrant in C:\Users\Aaron\AppData\Roaming\Sublime Text 3\Installed Packages\Vagrant.sublime-package", line 202, in execute
  File "Vagrant in C:\Users\Aaron\AppData\Roaming\Sublime Text 3\Installed Packages\Vagrant.sublime-package", line 135, in run_command
AttributeError: 'NoneType' object has no attribute 'items'

My settings:

{
    "vagrant_path": "C:\\HashiCorp\\Vagrant\\bin\\vagrant",
    "debug": true,
}
Stubbs commented 10 years ago

Try adding :

"additional_args": []

to your settings.

arosolino commented 10 years ago

Just so you know the error aaronjbaptiste reported is fixed in my changes. https://github.com/Stubbs/sublime-vagrant/pull/10

aaronjbaptiste commented 10 years ago

Thanks guys, i'll give that a go