I'm using chef-solo to provision a new vagrant VM. It's Ubuntu 12.10. Chef runs fine the first time, but fails to launch anytime thereafter.
The problem is that chef-solo needs to run using ruby 1.9.3, but one of my cookbooks installs ruby 2.0.0. It links the new version of ruby to /usr/local/ruby, so the system version is still available at /usr/bin/ruby.
The shebang line in /usr/bin/chef-solo is #!/usr/bin/env ruby
.
Is there a way I can set an environment variable in the Vagrantfile before chef-solo runs? Or is there another way to force vagrant to run chef-solo using /usr/bin/ruby?
UPDATE: I'm currently using the following command on the VM as a work-around:
sudo /usr/bin/ruby /usr/bin/chef-solo --config /tmp/vagrant-chef-1/solo.rb --override-runlist "my_runlist"
I'd like to force Vagrant to run something similar when I type vagrant provision
on the host.