title: Controlling Vagrant plugin dependencies via Ansible
body: <p>I have an Ansible playbook that installs Vagrant, and then instructs Vagrant to install a specific plugin. Vagrant has trouble installing a gem it needs, and says:</p>
  
  <pre>
  An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
  Make sure that `sudo gem install nokogiri -v '1.6.6.2'` succeeds before bundling.
  stdout: Installing the 'vagrant-aws --version '0.5.0'' plugin. This can take a few minutes...
  </pre>
  
  <p>While I have trouble installing Nokogiri using the command:</p>
  
  <pre>
  $ sudo gem install nokogiri -v '1.6.6.2'
  </pre>
  
  <p>as vagrant does it, I have found that I <em>can</em> install Nokogiri manually, using this command:</p>
  
  <pre>
  $ sudo gem install nokogiri -v 1.6.6.2 -- --use-system-libraries --with-xml2-include=/usr/include/libxml2
  </pre>
  
  <p>Even after I installed the gem manually, vagrant still fails if I manually tell it to install the plugin.</p>
  
  <p>Is there a way to get better control of these dependencies so that vagrant won't fail and my playbook will complete?</p>