3

我有以下详细信息:

流浪档案:

Vagrant.configure("2") do |config|
 config.vm.box = "Precise32"
 config.vm.box_url = "http://files.vagrantup.com/precise32.box"
 config.vm.synced_folder "./Public","/var/www/",create:true
 config.vm.network :private_network, ip: "192.168.55.55"
 config.vm.provision :shell, :path => "setup.sh"
end

外壳文件:

   sudo apt-get -y update
   sudo apt-get install apache2 php5 libapache2-mod-php5 
   sudo sudo apachectl restart

  The shell is s little limited but i want to get it to work first before i attempt all the other php stuff etc


  The error i get starts here:

  Do you want to continue [Y/n]? Abort.
  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:

然后继续尝试获取或点击文件

  Fetched 3,018 kB in 4s (681 kB/s)
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  The following extra packages will be installed:
    apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1
    libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert
  Suggested packages:
    www-browser apache2-doc apache2-suexec apache2-suexec-custom
    openssl-blacklist
  The following NEW packages will be installed:
    apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
    libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert
  0 upgraded, 10 newly installed, 0 to remove and 155 not upgraded.
  Need to get 1,845 kB of archives.
  After this operation, 5,314 kB of additional disk space will be used.
  Do you want to continue [Y/n]? Abort.


  Stderr from the command:

  stdin: is not a tty

我什至尝试过:

   config.vm.network :forwarded_port, host: 3003, guest: 3000

这就是失败,虽然我确实去 localhost:3000 或者我得到:

   SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
   Protocol mismatch.

我在 MAC OSX 10.8.5 上

还有它说你想继续[Y/n]的部分吗?

我不能自动为我选择它。

4

1 回答 1

1

您可以尝试在 apt-get install 中添加“-y”吗?喜欢: sudo apt-get -y install apache2 php5 libapache2-mod-php5 来克服“你想继续 [Y/n]”吗?- 尼基尔

于 2015-08-06T22:32:24.597 回答