# Gems between two different machines

**URL:** <https://www.ruby-forum.com/t/gems-between-two-different-machines/156788>\
**Category:** Rails\
**Created:** [January 2, 2009, 10:29pm UTC](https://www.ruby-forum.com/t/gems-between-two-different-machines/156788 "2009-01-02T22:29:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jschank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@jschank](https://www.ruby-forum.com/u/jschank)\
**Post date:** [January 2, 2009, 10:29pm UTC](https://www.ruby-forum.com/t/gems-between-two-different-machines/156788/1 "2009-01-02T22:29:37Z")

</div>

Hello,

I usually develop on a desktop machine, but I also have a laptop. I  
want to be able to ensure that the gems I’ve installed on one machine  
are available on the other.

$ gem env  
seems to tell me where the gems actually live. But I also seem to have  
a local ~/.gem directory. (and a .gemrc)

So my questions are these…

1. what are the local directories for?
2. Can I just copy the entire gem directory (from gem env) between two  
machines, and expect that to work?

Some possible flies in the ointment…

- I’m using Mac OS X Leopard
- The machines are different architectures (One is a G5, and one is an  
intel - but both are OS X)

Thanks,  
John Schank

---

<div class="post-metadata">

**Author:** ![jschank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@jschank](https://www.ruby-forum.com/u/jschank)\
**Post date:** [January 2, 2009, 10:52pm UTC](https://www.ruby-forum.com/t/gems-between-two-different-machines/156788/2 "2009-01-02T22:52:28Z")

</div>

Are you using Rails 2 ? Then you should add the gems into you  
application …

rake gems # List the gems that this  
rails application depends on  
rake gems:build # Build any native  
extensions for unpacked gems  
rake gems:install # Installs all required gems  
for this application.  
rake gems:refresh\_specs # Regenerate gem  
specifications in correct format.  
rake gems:unpack # Unpacks the specified gem  
into vendor/gems.  
rake gems:unpack:dependencies # Unpacks the specified gems  
and its dependencies into vendor/gems  
rake rails:freeze:gems # Lock this application to  
the current gems (by unpacking them into vendor/rails)  
rake rails:unfreeze # Unlock this application  
from freeze of gems or edge and return to a fluid use of system gems

---

<div class="post-metadata">

**Author:** ![jschank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@jschank](https://www.ruby-forum.com/u/jschank)\
**Post date:** [January 5, 2009, 7:29pm UTC](https://www.ruby-forum.com/t/gems-between-two-different-machines/156788/3 "2009-01-05T19:29:16Z")

</div>

Thanks for the reply.

Freezing the gems is certainly possible, but what about using gems  
outside of rails?

Basically I’m just wondering if there is a really simple way to keep  
two or more machines in sync with the same versions of various gems.  
Aside from tediously listing the gems on one machine, and then  
installing the missing ones on the other. And vice-versa.

John

---

<div class="post-metadata">

**Author:** ![jschank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@jschank](https://www.ruby-forum.com/u/jschank)\
**Post date:** [January 7, 2009, 5:15pm UTC](https://www.ruby-forum.com/t/gems-between-two-different-machines/156788/4 "2009-01-07T17:15:25Z")

</div>

Hi,

I have used gemsonrails(_gemsonrails_.rubyforge.org) plugin which helps  
us  
to freeze gems to a rails application. By this you can run your rails  
application with just ruby installed on any new machine

-NAYAK
