In my previous blog post, I documented how Ruby operates the environment configuration of the MongoDB database in a Windows environment. The last step describes the driver package for installing MongoDB. Using the Gem Online installation method. The purpose of this article is to use GEMS for offline installation of GEM kits when the target machine or environment cannot connect to the Internet.
1. in the https://rubygems.org/, according to the corresponding need to install the gem package name set corresponding URL link, if I need to install Bson,
in the browser input Https://rubygems.org/gems/bson, the interface is as follows:
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/9D/DE/wKioL1mH_vmjzMSiAADbG-p55sI593.png-wh_500x0-wm_ 3-wmp_4-s_1292159260.png "style=" Float:none; "title=" 11.png "alt=" Wkiol1mh_vmjzmsiaadbg-p55si593.png-wh_50 "/>
Keep pulling down.
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/9D/DF/wKiom1mH_vqgwbeJAACEt24-46I018.png-wh_500x0-wm_ 3-wmp_4-s_1070545390.png "style=" Float:none; "title=" 22.png "alt=" Wkiom1mh_vqgwbejaacet24-46i018.png-wh_50 "/>
Find the download button for the corresponding package and click Download. Get the corresponding gem package
2. Copy the corresponding gem package to the target machine, in the Windows environment,the cmd command line will enter the target path of the corresponding storage file .
Execute the command gem install./bson-4.2.2.gem–local, the Bson-4.2.2.gem in this directive is the gem package file that you just downloaded. after successful installation, see the following interface as shown:
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/9D/DF/wKioL1mIAcijP4dfAABZtYFtRqw236.png-wh_500x0-wm_ 3-wmp_4-s_482341105.png "title=" 33.png "alt=" Wkiol1miacijp4dfaabztyftrqw236.png-wh_50 "/>
Subsequent installation of the MONGO driver package continues in the same way.
When using offline installation of the gem package, be aware of the Gem Pack's succession dependencies. In this example, the installation of MONGO relies on installing Bson first, so the Bson gem package needs to be installed first. Dependencies can be seen on the https://rubygems.org/corresponding package path, as in this example, MONGO, as shown in the Red box area.
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/9D/DF/wKiom1mIA6fAP9vOAADcbYx_Tn4130.png-wh_500x0-wm_ 3-wmp_4-s_3607464929.png "title=" 44.png "alt=" Wkiom1mia6fap9voaadcbyx_tn4130.png-wh_50 "/>
When you install, follow the dependencies strictly. Otherwise there will be a corresponding error.
This article is from the "techfuture" blog, make sure to keep this source http://wanght89.blog.51cto.com/6778304/1954182
Ruby offline install GEM package in Windows environment