Skip to content

Instantly share code, notes, and snippets.

@marcusvmsa
Created March 7, 2012 13:49
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 marcusvmsa/1993267 to your computer and use it in GitHub Desktop.
Save marcusvmsa/1993267 to your computer and use it in GitHub Desktop.
Instalando várias GEMS de forma automátizada
#Primeiro eu jogo as gems do servidor em um arquivo .txt qualquer
gem list > my_gems.txt
#Esse é o script que vai instalar as gems
bulk_gems.rb
#! /usr/local/bin/ruby
STDIN.readlines.each do |l|
m = l.match /^(\S+) \((.*)\)/
unless m.nil?
gem_name, versions = m[1], m[2].split(',')
versions.each do |v|
system "gem install #{gem_name} --version #{v} --ignore-dependencies"
end
end
end
#E aqui eu instalo as gems listadas em my_gems.txt com o bulk_gems.rb
more my_gems.txt | bulk_gems.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment