gpt4 book ai didi

ruby - 在文件同步之前 vagrant up provisioning

转载 作者:太空狗 更新时间:2023-10-29 12:33:35 24 4
gpt4 key购买 nike

我是第一次玩 vagrant,想把它添加到我们相当大的项目中。如果我在文件同步后运行通过 vagrant ssh 编写的引导 shell 文件,一切正常。但是,在销毁 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

最佳答案

我假设您正在使用 Vagrants shell provisioner 运行该脚本?

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

cd /vagrant

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

关于ruby - 在文件同步之前 vagrant up provisioning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19533871/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com