简体   繁体   中英

Install Rails Gems

在我的公司中,生产服务器没有连接到互联网,因此当我们尝试将Rails应用程序放在这些服务器中时,我无法正常工作,因为显然无法捆绑这些宝石,我的问题是,我可以分发我的应用程式内有宝石吗?

You can use bundler to install your gems to the rails application vendor/gems directory:

$ bundle install vendor/gems

Alternately:

$ bundle package

References:
How do I freeze gems into a Rails 3 application?
bundler install
bundle package

You can also run your own internal gem server at your company. Copy just the gems your company uses to your gem server, as well as any gems developed internally. In your app's gemfile, just add source to use it:

source "http://rubygems.my_example_company.com"

It can be as easy as running 'gem server' on the gem server, or using something like the Gem in a Box project. See http://guides.rubygems.org/run-your-own-gem-server/ for more information on setting it up.

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