Installing Ruby offline using rvm

2019-03-30 19:37发布

问题:

I need to install Ruby-1.9.2 in an offline machine using rvm. I tried by copying ruby-1.9.2-p180.tar.gz in to ./rvm/archives and running rvm install ruby-1.9.2. But still rvm is trying to download Ruby from ftp.ruby-lang.org'. Any advice is greatly appreciated...

回答1:

I had a similar problem, where I want to deploy the ruby version and all associated gems to the production machines...

I would highly recommend that you use either "rsync' or 'scp -rp' to copy the complete subdirectory ~/.rvm to the target machine. If that machine is completely offline, you could of course copy that directory with 'cp -rp' to a flash-drive and then copy it to the non-networked machine.

One important Gotcha:

be sure that you use the identically named user account on all machines, if you replicate the .rvm directory!

I noticed that the internal book-keeping of RVM keeps track of some environment variables during installation of Ruby versions and gems, and that it keeps track in particular of the name of the user account that was used, and the path to the users's home directory. Beats me why they don't use $HOME and $USER , which are standard on all UNIXes.. seems like a real bug in RVM to me.

if you use the same user account for all machines, it will work just fine.