Create a gist now

Instantly share code, notes, and snippets.

deploy_user = node[:deploy][:user]
deploy_user_home = File.join('/', 'home', deploy_user)
rvm_version = "head"
execute "install_rvm_for_deploy_user" do
user deploy_user
command "curl -L | bash -s #{rvm_version}"
environment "HOME" => deploy_user_home
creates "#{deploy_user_home}/.rvm"
node['buildpack']['ruby_versions'].each do |ruby_version|
execute "install_rvm_ruby_#{ruby_version}" do
user deploy_user
environment "HOME" => deploy_user_home
command "#{deploy_user_home}/.rvm/bin/rvm install #{ruby_version} --autolibs=3"
file "#{deploy_user_home}/.rvmrc" do
content 'export rvm_trust_rvmrcs_flag=1'
owner deploy_user
mode 0644
pavlo commented May 13, 2013

Hi Artur, thanks for the gist!

I wanted also to set the default ruby after all, i.e. rvm --default use ruby-X.Y.Z. The command did not fail but no default ruby was set and the RVM suggested to use a login shell thing for the invocation, i.e. /bin/bash --login...

No matter what I tried to do I could not manage it to work properly. If you were to set default ruby, how would you do that?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment