我在ubuntu 18.04上的安装游民有问题。
我下载了流浪汉2.2.0 =>安装他的。
但是让错误无所事事
> ==> default: Destroying VM and associated drives... /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh/authentication/agent.rb:128:in > `block in identities': can't modify frozen NilClass (RuntimeError) > from > /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh/authentication/agent.rb:122:in > `times' from > /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh/authentication/agent.rb:122:in > `identities' from > /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh/authentication/key_manager.rb:104:in > `each_identity' from > /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh/authentication/methods/publickey.rb:19:in > `authenticate' from > /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh/authentication/session.rb:85:in > `block in authenticate' from > /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh/authentication/session.rb:71:in > `each' from > /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh/authentication/session.rb:71:in > `authenticate' from > /opt/vagrant/embedded/gems/2.2.0/gems/net-ssh-5.0.2/lib/net/ssh.rb:246:in > `start' from > /opt/vagrant/embedded/gems/2.2.0/gems/vagrant-2.2.0/plugins/communicators/ssh/communicator.rb:415:in > `block (2 levels) in connect' from > /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:93:in `block in > timeout' from /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:33:in > `block in catch' from > /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:33:in `catch' from > /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:33:in `catch' from > /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:108:in `timeout' from > /opt/vagrant/embedded/gems/2.2.0/gems/vagrant-2.2.0/plugins/communicators/ssh/communicator.rb:389:in > `block in connect' from > /opt/vagrant/embedded/gems/2.2.0/gems/vagrant-2.2.0/lib/vagrant/util/retryable.rb:17:in > `retryable' from > /opt/vagrant/embedded/gems/2.2.0/gems/vagrant-2.2.0/plugins/communicators/ssh/communicator.rb:388:in > `connect' from > /opt/vagrant/embedded/gems/2.2.0/gems/vagrant-2.2.0/plugins/communicators/ssh/communicator.rb:84:in `block in wait_for_ready' from > /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:93:in `block in > timeout' from /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:33:in > `block in catch' from > /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:33:in `catch' from > /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:33:in `catch' from > /opt/vagrant/embedded/lib/ruby/2.4.0/timeout.rb:108:in `timeout' from > /opt/vagrant/embedded/gems/2.2.0/gems/vagrant-2.2.0/plugins/communicators/ssh/communicator.rb:62:in `wait_for_ready' from > /opt/vagrant/embedded/gems/2.2.0/gems/vagrant-2.2.0/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in > `block in call'
“无所事事-调试”以相同的方式结束。 我试图将宝石分开放置,但这没有帮助。
我在做什么错了?
答案 0 :(得分:0)
答案 1 :(得分:0)
您需要通过执行vagrant
来删除gem uninstall vagrant
宝石,然后再在系统范围内进行安装,在ubuntu中,您可以从以下位置下载deb
文件
https://www.vagrantup.com/downloads.html
成功安装vagrant之后,您可以使用命令vagrant init hashicorp/precise64
创建一个VegrantFile,其中包含有关虚拟机的信息。
现在,要运行ssh,请通过运行vagrant up
来通过vagrant启动VM。
P.S。我正在使用Ubuntu 18.04,请确保卸载gem后不会遇到麻烦。
答案 2 :(得分:0)
要确认是否已安装vagrant
,请运行
$ vagrant --version
个人检查可用的最新开发人员版本(如上所述),请考虑使用HashiCorp Downloads。找到适合您的操作系统的一个。
在Ubuntu 18.04上安装Vagrant
安装virtualbox
,使您可以通过创建虚拟OS在另一个OS之上运行OS。
$ sudo apt install virtualbox
在下载vagrant
之前查找所有更新:
$ sudo apt update
$ curl -O https://releases.hashicorp.com/vagrant/2.2.10/vagrant_2.2.10_x86_64.deb
注意:您可以通过将2.2.10
替换为2.2.x
来获得所需的版本。检查下载页面后,它将下载版本(或最新版本)。
下载.deb
后,请运行以下命令安装vagrant
:
$ sudo apt install ./vagrant_2.2.10_x86_64.deb
同样,请确保您查看先前下载的版本(2.2.x
)
验证流浪者安装
$ vagrant --version
开始使用Vagrant
$ mkdir my_new_project
$ cd my_new_project
接下来,使用vagrant init
初始化一个新的Vagrantfile并指定要使用的框。框是Vagrant环境的软件包格式,并且是特定于提供程序的。您可以在Vagrant box catalog page上找到公共可用的无用物品盒的列表。
$ vagrant init ubuntu/bionic64
更好的是,在项目目录中,您可以创建VagrantFile
并在其中添加流浪者配置,如下所示:
$ touch Vagrantfile
您的配置,指定您的首选方框(并通过扩展指定)您的IP:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network "private_network", ip: "x.x.x.x"
config.vm.provider "virtualbox" do |vb|
vb.memory = '1024'
end
end
运行vagrant up
命令以按照流浪文件中的指定创建和配置虚拟机:
$ vagrant up
Vagrant还将项目目录安装在虚拟机中的/vagrant
上,这使您可以在主机上处理项目的文件。要进入虚拟机,请运行:
$ vagrant ssh
您可以使用以下命令停止虚拟机:
$ vagrant halt
最终,您可以停止计算机运行并破坏使用以下命令创建的所有资源:
$ vagrant destroy
卸载无业游民
如果您想一次卸载vagrant
,则可以运行以下命令(如果需要,可以添加sudo
特权):
$ rm -rf /opt/vagrant
$ rm -f /usr/bin/vagrant
检查是否成功卸载:
$ which vagrant