使用 Vagrant 和 Virtual box 创建开发服务器时出错
Error in creating a Development Server with Vagrant and Virtual box
我对 Web 开发还很陌生,使用 django 创建网站并使用 vagrant 和 virtual 创建开发服务器 box.I 已经为服务器定义了一个 vagrant 文件以使用基本图像或框 ubuntu/bionic64
后来也修改了
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ubuntu/bionic64"
config.vm.box_version = "~> 20200304.0.0"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.provision "shell", inline: <<-SHELL
systemctl disable apt-daily.service
systemctl disable apt-daily.timer
sudo apt-get update
sudo apt-get install -y python3-venv zip
touch /home/vagrant/.bash_aliases
if ! grep -q PYTHON_ALIAS_ADDED /home/vagrant/.bash_aliases; then
echo "# PYTHON_ALIAS_ADDED" >> /home/vagrant/.bash_aliases
echo "alias python='python3'" >> /home/vagrant/.bash_aliases
fi
SHELL
end
但是当我尝试在 git bash 中使用命令 vagrant up
创建开发服务器时,它显示错误
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/bionic64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: ~> 20200304.0.0
The box 'ubuntu/bionic64' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Vagrant Cloud, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://vagrantcloud.com/ubuntu/bionic64"]
Error: SSL certificate problem: self signed certificate in certificate chain
我应该怎么做才能清除这个错误?
将第二行改为
config.vm.box = "hashicorp/bionic64"
我有同样的错误。我不确定如何找到你的盒子
流浪者文件。登录到 hashicorp 网站,找到了一个适合我使用的盒子。
如果以上不适合您,您也可以这样做。
我检查后发现真正的问题是 windows 防火墙,它通过干扰 SSL 证书制造了所有麻烦
我对 Web 开发还很陌生,使用 django 创建网站并使用 vagrant 和 virtual 创建开发服务器 box.I 已经为服务器定义了一个 vagrant 文件以使用基本图像或框 ubuntu/bionic64 后来也修改了
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ubuntu/bionic64"
config.vm.box_version = "~> 20200304.0.0"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.provision "shell", inline: <<-SHELL
systemctl disable apt-daily.service
systemctl disable apt-daily.timer
sudo apt-get update
sudo apt-get install -y python3-venv zip
touch /home/vagrant/.bash_aliases
if ! grep -q PYTHON_ALIAS_ADDED /home/vagrant/.bash_aliases; then
echo "# PYTHON_ALIAS_ADDED" >> /home/vagrant/.bash_aliases
echo "alias python='python3'" >> /home/vagrant/.bash_aliases
fi
SHELL
end
但是当我尝试在 git bash 中使用命令 vagrant up
创建开发服务器时,它显示错误
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/bionic64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: ~> 20200304.0.0
The box 'ubuntu/bionic64' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Vagrant Cloud, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://vagrantcloud.com/ubuntu/bionic64"]
Error: SSL certificate problem: self signed certificate in certificate chain
我应该怎么做才能清除这个错误?
将第二行改为
config.vm.box = "hashicorp/bionic64"
我有同样的错误。我不确定如何找到你的盒子 流浪者文件。登录到 hashicorp 网站,找到了一个适合我使用的盒子。 如果以上不适合您,您也可以这样做。
我检查后发现真正的问题是 windows 防火墙,它通过干扰 SSL 证书制造了所有麻烦