vagrant up命令无法创建vm,但终端中没有出现错误

问题描述 投票:0回答:1

我按照vagrant website上的教程下载并选择了一个框,这里的步骤如下:

  1. $mkdir vagrant_getting_started
  2. $ cd vagrant_getting_started
  3. $ vagrant init hashicorp/precise64
  4. $ vagrant box add hashicorp/precise64
  5. 按2进入virtualbox
  6. 编辑vagrantfile内容

至:

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"
end

每个输出都很好,然后我运行命令vagrant up然后vagrant ssh

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'hashicorp/precise64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'hashicorp/precise64' version '1.1.0' is up to date...
==> default: Destroying VM and associated drives...
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/win32/registry.rb:72:in `find': unknown encoding name - CP720 (ArgumentError)
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/win32/registry.rb:72:in `<module:Win32>'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/win32/registry.rb:4:in `<top (required)>'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/win32/resolv.rb:7:in `<top (required)>'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/resolv.rb:172:in `<class:Hosts>'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/resolv.rb:169:in `<class:Resolv>'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/resolv.rb:39:in `<top (required)>'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/network.rb:2:in `<top (required)>'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action.rb:77:in `block in action_boot'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action.rb:62:in `tap'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action.rb:62:in `action_boot'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action.rb:344:in `block (4 levels) in action_start'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/call.rb:47:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/box_check_outdated.rb:84:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/match_mac_address.rb:22:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/discard_state.rb:15:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/import.rb:74:in `import'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/import.rb:13:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb:17:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/prepare_clone.rb:15:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/customize.rb:40:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/machine.rb:239:in `action_raw'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/machine.rb:208:in `block in action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/environment.rb:614:in `lock'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/machine.rb:194:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/machine.rb:194:in `action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.3/gems/vagrant-2.2.3/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

MAKKAH@DESKTOP-5B1U0AH MINGW64 /e/AYA/udacity/sql/vagrant_getting_started
$ vagrant ssh
VM must be created before running this command. Run `vagrant up` first.

MAKKAH@DESKTOP-5B1U0AH MINGW64 /e/AYA/udacity/sql/vagrant_getting_started
$

vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"
end

我按照流浪网站上的教程改变了它的内容

应该怎样做才能成功创建vm并登录以开始工作我的项目?我用的是Windows 10。

postgresql vagrant virtualbox git-bash vagrantfile
1个回答
0
投票

好的,我通过更改代码页解决了这个问题

$ chcp.com 1252

但现在我收到另一个错误,或者在另一个问题上发布。

© www.soinside.com 2019 - 2024. All rights reserved.