Skip to content

Instantly share code, notes, and snippets.

@therobot
Created June 23, 2009 11:58
Show Gist options
  • Save therobot/134497 to your computer and use it in GitHub Desktop.
Save therobot/134497 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
gems=`gem list --local`
gem_command="/usr/local/ruby/bin/gem"
gems.each do |gem|
gem.strip!
gem.delete!("()")
gem_args = gem.split(/ /)
command = "sudo #{gem_command} install #{gem_args[0]} "
gem_args.delete(gem_args[0])
gem_args.each do |version|
version.delete!(",")
final_command=command + "-v #{version}"
`#{final_command}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment