Skip to content

Instantly share code, notes, and snippets.

@ryansch
Forked from apsoto/rvm-your-chef.rb
Created April 19, 2011 16:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryansch/928628 to your computer and use it in GitHub Desktop.
Save ryansch/928628 to your computer and use it in GitHub Desktop.
ruby_block "rvm use default" do
block do
Chef::Mixin::Command.popen4('bash -l -c "rvm use default && env"') do |p,i,o,e|
o.each_line do |line|
next if line.nil?
line.chomp!
next if line.empty?
env_bits = line.split("=")
ENV[env_bits[0]] = env_bits[1]
end
end
end
end
# All future stuff should get the rvm environment
gem_package "rails"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment