我有如下的vagrant文件,其中包含一个shell provisioner,在Windows 7 VirtualBox上运行良好,但在我的MacBook Pro OSX 10.9.2上运行失败。
更具体地说,该provisioner似乎无法安装requirements.txt。如果我以root身份SSH登录到框中并重新运行bootstrap.sh,它将正常工作。我知道长错误消息会很有帮助,但我认为问题是针对了解为什么虚拟框设置在一个环境下工作而在另一个环境下不工作。尤其是在启动这种简单的shell脚本时。
非常感谢任何想法或建议!
Vagrant File
Vagrant File
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = "test-box"
config.vm.box = "hashicorp/precise64"
config.vm.provision :shell, :path => "bootstrap.sh"
end
bootstrap.sh
#!/usr/bin/env bash
apt-get update
apt-get install -y build-essential curl git libffi-dev python-dev python-pip \
libxml2-dev libxslt1-dev python-software-properties g++ make
pip install --upgrade distribute
pip install -r /vagrant/requirements.txt
requirements.txt
Scrapy>=0.18.2
Twisted>=13.1.0
lxml>=3.2.3
queuelib>=1.0
w3lib>=1.3