Jeff
Jeff

Reputation: 4433

How do you package a ruby application for offline installation?

I have an intranet server with no internet access that I need to deploy a RoR application on it.

My process will be to download Ruby, install it, download Rails, install it, etc. But I have multiple gems in my Gemfile I'd like to install. How can I get these on the intranet server? Do I have to download them all separately, or is there there a way to package them up?

Upvotes: 1

Views: 1022

Answers (1)

infused
infused

Reputation: 24337

You can tell bundler to vendor all the gems needed for your app, by running:

bundle install --deployment

That will create a vendor directory in the root of your application. Make sure you include this directory when moving the app to the standalone server. You will still need to install Ruby, RubyGems, and the bundler gem.

For Ruby and RubyGems you can download their respective installers. You can download a copy of the bundler with gem fetch

gem fetch bundler

This will download a gem file like bundler-1.6.5.gem, which you can install on the standalone server with:

gem install bundler-1.6.5.gem

Upvotes: 1

Related Questions