Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Vagrant with Chef-solo to create a dev environment VM. Problem is, the Debian Chef package depends on a certain version of RubyGems to run, but I want the VM to have a much newer installed-from-source RubyGems version.

Is there a way in Vagrant to run some scripts/commands before Chef-solo is invoked and does its thing? That way I can switch the symlinks between the rubygems versions before and after Chef-solo has run.

share|improve this question

What 'debian chef package'? The one from Opscode's apt repository? Or is something built into the basebox you're using?

You could probably use the shell script provisioner in vagrant to do this. However, I would build my own base box. "Veewee" is an excellent tool for doing this very quickly (relatively, takes about 15-20 mins).

share|improve this answer

The easiest way would be to use the default Ruby that's installed in the image to run chef, and install Ruby and RubyGems with chef, maybe managed by something like rbenv or rvm

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.