Surprising this isn’t better Google-documented. Here’s how I do it.
Make a list of your existing gems in a text file (run from machine with gems already installed):
sudo dpkg --get-selections | awk '{print $1}' > installedpackages
Copy the file to your new system. Then run:
cat installedpackages | xargs sudo aptitude install -y
It’s run through each line of your gemlist file and run “sudo aptitude install -y” on it.
What about packages that are set to ‘deinstall’? What are the tradeoffs with using ‘dpkg –set-selections’?