Setting up a new machine for rails.

I am wondering if there is an quick and easy way to set up a new machine which duplicates the rails env of another machine. I have in the course of last several months installed many gems and it would be great if I didn't have to make a list and re-install all the gems.

On a related matter... Is there a way to tie this into migrations? I mean if I need a new gem is there any way I can get capistrano to migrate my gems as well as my database schema changes?

Thanks.

#!/bin/sh

for x in `gem list --local | grep '(' | sort | awk 'BEGIN { FS = " " } { print $1 }'`; do   echo "gem install $x" done

for x in `gem list --local | grep '(' | sort | awk 'BEGIN { FS = " " } { print $1 }'`; do   echo "gem install $x" done

Wow. Thanks. I would have to pipe this to a file and remove any windows specific gems but that's great.

wouldnt you want something like:

echo "gem install $x -y"

to install all dependencies? I think it would also get stuck on the multiple version menu that always seems to come up, wouldn't it?

- rob

wouldnt you want something like:

echo "gem install $x -y"

to install all dependencies?

It produces a list of _all_ the gems installed, what dependencies?

I think it would also get stuck on the multiple version menu that always seems to come up, wouldn't it?

You would need to run it by hand, yes.

I’ve had success eliminating the prompt by passing the version number, like this:

gem install -y mongrel --version 0.3.13.4