【发布时间】:2019-02-17 22:44:52
【问题描述】:
我按照vagrant website上的教程下载并选择了一个盒子,这里是步骤:
$mkdir vagrant_getting_started$ cd vagrant_getting_started$ vagrant init hashicorp/precise64$ vagrant box add hashicorp/precise64- 按 2 进入虚拟框
- 编辑 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
$
流浪文件:
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
end
我按照 vagrant 网站上的教程更改了它的内容
应该怎么做才能成功创建虚拟机并登录以开始我的项目? 我使用的是 Windows 10。
【问题讨论】:
-
非常感谢,我应该删除这个问题吗?在修复这个明显的错误后,我实际上出现了另一个错误。
-
共享文件夹错误,请确保虚拟机中的来宾添加与您安装的VirtualBox版本匹配
标签: postgresql vagrant virtualbox git-bash vagrantfile