You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use multiple provisioners to remove the need to have anything other than virtualbox/vagrant installed as follows:
# add the following before the `Vagrant.configure` line
$script = <<-SCRIPT
cat > /root/.gemrc << 'EOF'
gem: --no-ri --no-rdoc
EOF
if ! grep -q cd-to-directory "/home/vagrant/.bashrc"; then
echo "- setting up auto chdir on ssh"
echo "\n[ -n \\"\\$SSH_CONNECTION\\" ] && cd /vagrant # cd-to-directory" >> "/home/vagrant/.bashrc"
fi
cd /vagrant
if [ ! -f /opt/chef/embedded/bin/librarian-chef ]; then
echo "- installing librarian-chef"
/opt/chef/embedded/bin/gem install librarian-chef > /dev/null
fi
echo "- running librarian-chef"
/opt/chef/embedded/bin/librarian-chef install > /dev/null
SCRIPT
And then place this before the existing config.vm.provision block:
config.vm.provision :shell, inline: $script
This removes the need to install gems outside of the vagrant vm.
A few notes:
Other than git, I don't run any code outside of a vm on my mac. It's a way to ensure that all development environments can be replicated anywhere without my poking/prodding, since I regularly rebuild my vms.
This requires the use of the opscode ruby to install things. A bit annoying, and there should be some fallbacks, but still good to note.
This sort of pollutes the embedded opscode ruby. We could install ruby1.9 (I do that for other vms) but it doesn't matter that much.
The text was updated successfully, but these errors were encountered:
You can use multiple provisioners to remove the need to have anything other than virtualbox/vagrant installed as follows:
And then place this before the existing
config.vm.provision
block:This removes the need to install gems outside of the vagrant vm.
A few notes:
The text was updated successfully, but these errors were encountered: