# Setting up a new machine for rails

**URL:** <https://www.ruby-forum.com/t/setting-up-a-new-machine-for-rails/78435>\
**Category:** Rails\
**Created:** [December 5, 2006, 9:16pm UTC](https://www.ruby-forum.com/t/setting-up-a-new-machine-for-rails/78435 "2006-12-05T21:16:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_U](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90db22/32.png) [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Post date:** [December 5, 2006, 9:16pm UTC](https://www.ruby-forum.com/t/setting-up-a-new-machine-for-rails/78435/1 "2006-12-05T21:16:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tim\_U](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90db22/32.png) [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Post date:** [December 7, 2006, 6:15pm UTC](https://www.ruby-forum.com/t/setting-up-a-new-machine-for-rails/78435/2 "2006-12-07T18:15:55Z")

</div>

On 12/5/06, Tim U. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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.

#!/bin/sh

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

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![Tim\_U](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90db22/32.png) [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Post date:** [December 8, 2006, 3:47am UTC](https://www.ruby-forum.com/t/setting-up-a-new-machine-for-rails/78435/3 "2006-12-08T03:47:40Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![Tim\_U](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90db22/32.png) [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Post date:** [December 8, 2006, 9:08am UTC](https://www.ruby-forum.com/t/setting-up-a-new-machine-for-rails/78435/4 "2006-12-08T09:08:03Z")

</div>

On 12/7/06, Greg D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> { print $1 }'`; do  
> echo “gem install $x”  
> done

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  
–  
[http://www.robsanheim.com](http://www.robsanheim.com)  
[http://www.seekingalpha.com](http://www.seekingalpha.com)  
[http://www.ajaxian.com](http://www.ajaxian.com)

---

<div class="post-metadata">

**Author:** ![Tim\_U](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90db22/32.png) [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Post date:** [December 8, 2006, 4:30pm UTC](https://www.ruby-forum.com/t/setting-up-a-new-machine-for-rails/78435/5 "2006-12-08T16:30:59Z")

</div>

On 12/8/06, Rob S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![Tim\_U](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90db22/32.png) [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Post date:** [December 8, 2006, 9:02pm UTC](https://www.ruby-forum.com/t/setting-up-a-new-machine-for-rails/78435/6 "2006-12-08T21:02:01Z")

</div>

On 12/8/06, Greg D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 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

–  
Scott B.  
Electro Interactive, Inc.  
Office: 813-333-5508

> **[Electro Interactive - Web Development. Ruby on Rails. Web Standards.](http://www.electrointeractive.com)**
>
> Electro Interactive is a full service new media design and development company.
