public
Last active

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
bash "install rvm" do
user project_id
environment ({'HOME' => "/home/#{user_id}"})
code "curl -L get.rvm.io | bash -s stable; echo '[[ -s \"$HOME/.rvm/scripts/rvm\" ]] && . \"$HOME/.rvm/scripts/rvm\"' >> ~/.bashrc"
not_if "test -d /home/#{project_id}/.rvm"
end
 
bash "install ruby #{ruby_version}" do
user project_id
environment ({'HOME' => "/home/#{user_id}"})
code "PATH=$PATH:$HOME/.rvm/bin; rvm install #{ruby_version};"
not_if "test -d /home/#{project_id}/.rvm/rubies/#{ruby_version}"
end
 
bash "install ruby #{ruby_version} as default in rvm" do
user user_id
environment ({'HOME' => "/home/#{user_id}"})
code "PATH=$PATH:$HOME/.rvm/bin; rvm use #{ruby_version} --default"
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.