Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby gem dependencies on offline server

I have a server that is totally disconnected from the Internet (for some strange security reasons).

How can I make the Ruby dependencies to various gems work in that environment? It might work with Bundler, but how do I install Bundler using gem without a Internet connection?

like image 459
Peter B Avatar asked Jul 02 '12 09:07

Peter B


1 Answers

You can download bundler as a .gem file from rubygems and install it on the server with

gem install /path/to/bundler.gem

Then you can pack all gems required for your application into ./vendor/cache directory with

bundle package

If now you deploy your app (along with ./vendor/cache directory) to the server and run

bundle install --local

bundler won't go to rubygems, but instead will install all gems from ./vendor/cache directory.

See bundler-package docs for more information.

like image 166
KL-7 Avatar answered Oct 10 '22 23:10

KL-7