Skip to content

Instantly share code, notes, and snippets.

@zozo
Created May 24, 2012 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zozo/2780426 to your computer and use it in GitHub Desktop.
Save zozo/2780426 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment