如何解决Vagrant中的mkdir无效参数错误?

时间:2014-08-05 15:00:28

标签: vagrant vagrantfile

我添加了.box,当我运行命令" vagrant up"我收到以下错误,我正在使用Windows操作系统。如何解决错误的任何建议?

E:\Test_Prj\Vagrant_05Aug2014>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'test-phil'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: Vagrant_05Aug2014_default_1407248787170_35925
==> default: Destroying VM and associated drives...
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir': Invalid argument - E:/
Test_Prj/Vagrant_05Aug2014/file: (Errno::EINVAL)
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in m
kdir_p'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb:203:in `each'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/pathname.rb:556:in `mkpath'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/synced
_folders.rb:56:in `block (2 levels) in call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/synced
_folders.rb:41:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/synced
_folders.rb:41:in `block in call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/synced
_folders.rb:40:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/synced
_folders.rb:40:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/synced
_folder_cleanup.rb:28:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/synced_folders/nfs/action
_cleanup.rb:19:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/prepare_nfs_valid_ids.rb:12:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle
_forwarded_port_collisions.rb:160:in `handle'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle
_forwarded_port_collisions.rb:42:in `block in call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:434:in
 `lock'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle
_forwarded_port_collisions.rb:41:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/prepare_forwarded_port_collision_params.rb:30:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/env_se
t.rb:19:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/provis
ion.rb:80:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/clear_forwarded_ports.rb:15:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/set_name.rb:50:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/clean_machine_folder.rb:17:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/check_accessible.rb:18:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:i
n `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116
:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `b
usy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.r
b:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:i
n `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116
:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `b
usy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.r
b:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:i
n `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116
:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `b
usy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.r
b:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/box_ch
eck_outdated.rb:36:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/config
_validate.rb:25:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/check_virtualbox.rb:17:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:i
n `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/match_mac_address.rb:16:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/import.rb:32:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/customize.rb:40:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/check_accessible.rb:18:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:i
n `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116
:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `b
usy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.r
b:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/config
_validate.rb:25:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:i
n `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle
_box.rb:56:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:i
n `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116
:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `b
usy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.r
b:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/acti
on/check_virtualbox.rb:17:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:i
n `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116
:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `b
usy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:i
n `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:196:in `ac
tion_raw'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:173:in `bl
ock in action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:434:in
 `lock'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `ca
ll'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `ac
tion'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/batch_action.rb:82:in
 `block (2 levels) in run'

1 个答案:

答案 0 :(得分:0)

我遇到了这个错误:

C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir': Invalid argument - C:/Users/atexo/WORKSPACE/lt_api/.vagrant/machines/default/C: (Errno::EINVAL)

我添加了一行:

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'

就在行前:

vagrantKey = "#{vagrant_dot}/machines/default/#{ENV['VAGRANT_DEFAULT_PROVIDER']}/private_key"

一切正常