Reputation: 1481
I'm setting up a default vagrant dev environment for ruby and I would like to use ruby-build, but without rbenv, because there's really no need for multiple ruby versions in a project specific vagrant.
Unfortunately all of the examples I can find use rbenv or rvm or the brightbox ppa. I'm not familiar enough with chef + vagrant to get the json right for the ruby_build recipe, but I know it must be something simple I'm missing.
Here's what I have at the moment. It runs fine, ruby-build is in the path, but it's not installing any rubies and doesn't tell me what the problem is.
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'ubuntu/trusty64'
# Configurate the virtual machine to use 1GB of RAM
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', '1024']
end
# Forward the Rails server default port to the host
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ['cookbooks', 'site-cookbooks']
chef.add_recipe 'apt'
chef.add_recipe 'nodejs'
chef.add_recipe 'ruby_build'
chef.add_recipe 'vim'
chef.add_recipe 'postgresql::server'
chef.add_recipe 'postgresql::client'
chef.add_recipe 'postgresql::contrib'
chef.json = {
ruby_build: {
upgrade: true,
install: {
definition: '2.1.2'
}
},
postgresql: {
password: {
postgres: ''
}
}
}
end
end
Upvotes: 0
Views: 202
Reputation: 54211
The ruby_build::default
recipe only sets up the required pre-reqs. You need to make your own wrapper cookbook that depends on ruby_build
and uses the ruby_build_ruby
LWRP. See the linked readme for an example of that.
Upvotes: 1