To install rvm, I have used cookbook you specified. What you need is to add it to Cheffile:
cookbook 'rvm', :git => 'git://github.com/fnichol/chef-rvm.git', :ref => '24ecbb0'
I have used ref, because last version wasn't working properly(don't know if it was fixed, but you can try my way, then switch and tryout newer). Next step is to add rvm to the role you are using for your node:
'recipe[rvm::user]',
after you specified this role in nodefile(in your tutorial it is Vagrantfile), you can configure rvm installation like this:
'rvm' => {
'installer_url' => 'https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer',
'branch' => 'none',
'version' => '1.17.10',
'user_installs' => [{
'user' => 'someuser',
'default_ruby' => 'ruby-1.9.3-p286@mygemsetname'
}]
}
thats it. Rvm should be installed for someuser
with ruby-1.9.3-p286@mygemsetname
gemset. To install Rails in specific dir and other custom actions you will need to learn how to write own cookbooks, it is very easy, you will need to log-in as someuser
, cd to dir you need and execute gem install
, then rails new
(of course if you want to install rvm/rails as a user, not systemwide)
UPD: To install custom gems you can use chef-rvm or your own cookbook:
./site_cookbooks/mycookbook/recipes/default.rb
execute 'install mysql2 gem' do
command 'gem install mysql2'
not_if 'gem list | grep mysql2'
end