我有一個簡單的流浪盒,在構建教程的過程中正在構建。我在這裏建立了我的流浪文件。流浪外殼供應運行但失敗
# -*- 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.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.provision :shell, :path => "bootstrap.sh"
#config.vm.network "forwarded_port", guest: 80, host: 8080
end
這似乎工作正常,正在等待一些其他配置,但我與供應有問題。
它發現Shell腳本沒有錯誤。它甚至建立了流浪箱。然而,當它完成當我什麼我安裝ssh來安裝安裝我得到這個錯誤
==> default: stdin: is not a tty
==> default: bash: /tmp/vagrant-shell: /user/bin/env: bad interpreter: No such file or directory
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell
Stdout from the command:
Stderr from the command:
stdin: is not a tty
bash: /tmp/vagrant-shell: /user/bin/env: bad interpreter: No such file or directory
。當我通過命令在終端命令中運行bash腳本時,它可以工作。這是我的bash腳本。
#!/user/bin/env bash
#install
sudo apt-get update
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y wget php5 apache2 php5-mcrypt php5-curl git
sudo apt-get update
#apache onfig
sudo a2enmod rewrite
#Symlink for local development
#remove the WWW for Apache
sudo rm -rf /var/www
#symlink for local directory ln -fs {PATH TO LOCAL PROJECT} /var/www
sudo ln -fs /pathtolocaldirectory /var/www
#Restart Apache
sudo service apache2 restart
這就是它我改變了環境爲 #!/ bin/bash 並且排序問題。感謝您的幫助! –
@AaronBlakeley寫的是我在Windows 8.1下的解決方案 - 用#!/ bin/bash替換'#!/ usr/bin/env bash' –