新手问题 非联网计算机安装 rails 的各种第三方 gem

davidminaki · March 05, 2014 · Last by etnl replied at March 08, 2014 · 2614 hits

是不是先下载 gem,copy 到非联网计算机,再安装,如何安装,有人搞过吗?请指教。

可以用bundle package的方式,更多细节你可以搜索一下

兄弟,拉个宽带吧。。

公司内部机器需要隔绝互联网的怎么拉网线

#2 楼 @pynix 与互联网隔离的

gem install [package_name_with_version in gems cache folder].gem

最方便的是做一个 rubygems.org 的镜像

嗯..内部做一个镜像呗...

#8 楼 @lyfi2003 如何做镜像,有人做过吗?请指教

#10 楼 @davidminaki http://ruby-china.org/topics/264 类似这样,我们公司内部也有一个。目前是自己开发的。难度不算大。

带个 3g 网卡吧,或者在外面 bundle cache 再烤回来

把需要的 gem 下到本地目录用 gem install --path 来安装

$ bundle package [--no-prune] [--all] The package command will copy the .gem files for your gems in the bundle into ./vendor/cache. Afterward, when you run bundle install, Bundler will use the gems in the cache in preference to the ones on rubygems.org.

Additionally, if you then check that directory into your source control repository, others who check out your source will be able to install the bundle without having to download any additional gems.

就 bundle package 吧

You need to Sign in before reply, if you don't have an account, please Sign up first.