简体   繁体   中英

How to copy Ruby gem from one server to another

Is there a way for a particular ruby gem (mysql gem) to be copied from one server to another (both are similar servers)?

In my case, the other server is a production server and gem install mysql is failing to compile there as rubymysqllib is missing and can't install build dependencies there.

Basically my question is: how can I copy a gem from one server to another server?

I couldn't figure out if it is a good practice but I did this way sometimes and worked.

To copy all gems I just copied and past the folder C:\\Ruby187\\lib\\ruby\\gems\\ (adapt this in accordance with your case) from one machine to another.

To copy a single gem I went inside the gems folder and copied the files with same name (of the gem) inside of the respective folders.

C:\Ruby187\lib\ruby\gems\1.8\cache
C:\Ruby187\lib\ruby\gems\1.8\doc*
C:\Ruby187\lib\ruby\gems\1.8\gems*
C:\Ruby187\lib\ruby\gems\1.8\specifications
#*doc and gems are optional

Another way I found, but I never did is like this .

CAUTION

When you copy the gems like this you are not verifying the dependencies and it may cause bad behavior of your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM