【问题标题】:vagrant up provisioning before files sync在文件同步之前 vagrant up 配置
【发布时间】:2013-11-01 06:25:50
【问题描述】:

我是第一次玩 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

【问题讨论】:

    标签: ruby linux ubuntu bundler vagrant


    【解决方案1】:

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

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

    cd /vagrant
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多