2

我第一次玩 vagrant,想把它添加到我们相当大的项目中。如果我运行我编写的引导 shell 文件,但vagrant ssh在文件同步后一切正常。但是,在销毁 VM 并第一次执行 vagrant up 后,我的 Ubuntu 12.04 64 位机器一旦命中就会出现一堆错误bundle install

Bundler::GemfileNotFound


Stderr from the command:

stdin: is not a tty
dpkg-preconfigure: unable to re-open stdin: No such file or directory
dpkg-preconfigure: unable to re-open stdin: No such file or directory
dpkg-preconfigure: unable to re-open stdin: No such file or directory
dpkg-preconfigure: unable to re-open stdin: No such file or directory
dpkg-preconfigure: unable to re-open stdin: No such file or directory

假设这是因为它在我的Gemfile/Gemfile.lock完成同步之前得到了这个。情况可能并非如此,但似乎确实如此。我将如何解决这个问题?

这是我在 v up 上运行的完整 boostrap.sh 脚本

#!/usr/bin/env bash

apt-get update
apt-get -y install git

# Required for nokogiri
apt-get -y install libxslt-dev libxml2-dev

# Required for eventmachine
apt-get -y install build-essential

# Required for typhoeus
apt-get -y install libcurl3-dev

apt-get -y install ruby1.9.3
gem install bundler
bundle install
4

1 回答 1

1

我假设您正在使用 Vagrants shell 配置程序运行该脚本?

你的 gem 文件在哪里?很可能它与您Vagrantfile在主机上的文件夹位于同一文件夹中,因此请尝试添加:

cd /vagrant

之前bundle install,它应该工作......

于 2013-10-24T00:41:57.067 回答