Skip to content

Instantly share code, notes, and snippets.

@choonkeat
Created September 16, 2009 16:10
Show Gist options
  • Save choonkeat/188128 to your computer and use it in GitHub Desktop.
Save choonkeat/188128 to your computer and use it in GitHub Desktop.
# this ruby script generates a shell script to reinstall/recompile your gems
puts '#!/bin/bash'
puts 'export ARCHFLAGS="-arch x86_64"'
`gem list`.each do |line|
if line =~ /\s*(.+)\s+\((.+)\)/
gem_name, versions = [$1, $2]
versions.split(/, /).each do |version|
puts "gem install #{gem_name} --version='#{version}'"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment