Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created September 28, 2009 13:13
Show Gist options
  • Save diasjorge/195437 to your computer and use it in GitHub Desktop.
Save diasjorge/195437 to your computer and use it in GitHub Desktop.
gem_cmd = "/opt/ruby-enterprise/bin/ruby /opt/ruby-enterprise/bin/gem --no-ri --no-rdoc"
a = %x(gem list)
gems = []
a.each_line do |l|
gem, *versions = l.gsub(/\(|\)|,/,"").split
versions.each do |v|
gems << "#{gem} -v #{v}"
end
end
%x(sudo #{gem_cmd} install #{gems.join(" ")})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment