Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created November 24, 2009 14:34
Show Gist options
  • Save diasjorge/241904 to your computer and use it in GitHub Desktop.
Save diasjorge/241904 to your computer and use it in GitHub Desktop.
def gem_list(bin)
a = %x(#{bin} list)
gems = []
a.each_line do |l|
gem, *versions = l.gsub(/\(|\)|,/,"").split
versions.each do |v|
gems << "#{gem} -v #{v}"
end
end
gems
end
ree_gem_bin = "/opt/ruby-enterprise/bin/ruby /opt/ruby-enterprise/bin/gem"
src_gem_bin = "/usr/bin/gem"
gem_install_cmd = "#{ree_gem_bin} install --no-ri --no-rdoc"
gems = gem_list(src_gem_bin)
already_installed_gems = gem_list(ree_gem_bin)
gems.each do |gem|
next if already_installed_gems.include?(gem)
puts "installing #{gem}"
`sudo #{gem_install_cmd} #{gem}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment