Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I copy gems to another server?

Tags:

ruby

rubygems

gem

I have a server, "server1", set up with with Ruby 1.8.7 and Rubygems 1.6.2, with several gems installed.

I want to replicate it on another server "server2" which has matching versions of Ruby and Rubygems. I FTP'ed the installed gem folders from server1 to server2 into the same paths.

Now, in server2 when I do:

gem list

no gems appear, although they were copied into the correct gem path.

Can anyone tell me whether this is a correct way to install gems, or whether there are better option rather than installing each gem on its own?

like image 439
Usering Avatar asked Feb 03 '12 21:02

Usering


1 Answers

If you do gem env on server1 you should see a GEM PATHS: entry, followed by some directories. Those are what need to be duplicated.

Rubygems keeps track of the installed gems, but I don't remember exactly where. You should be able to get everything by doing the containing folders.

like image 89
the Tin Man Avatar answered Sep 24 '22 16:09

the Tin Man