title: vagrant up provisioning before files sync
body: <p>I'm playing with vagrant for the first time and want to add it to our fairly large project. If I run the bootstrapping shell file I wrote though <code>vagrant ssh</code> after the files sync everything works great. However, after destroying the VM and doing a vagrant up for the first time causes a bunch of errors to occur on my Ubuntu 12.04 64bit machine once it hits <code>bundle install</code></p>
  
  <pre><code>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
  </code></pre>
  
  <p>I'm <em>assuming</em> this is because it gets to this before my <code>Gemfile</code> / <code>Gemfile.lock</code> finishes syncing. This might not be the case, but it seems like it is. How would I get around this?</p>
  
  <p>Here's my full boostrap.sh script that runs on v up</p>
  
  <pre><code>#!/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
  </code></pre>