Ruby Bundle Install in deployment mode

441 views Asked by At

I'm installing a ruby git-repo on several servers which have no internet connectivity. I had cloned that repo to my local machine, and used $ bundle install --path vendor/bundle to package all dependencies. Then I copied the whole directory to the target server, and tried $ bundle install --deployment, which still attempting resources from rubygems.org, hence not solving any dependencies as expected:

Fetching source index for https://ruby.taobao.org/ Could not find ffi-1.9.3 in any of the sources

According to bundler.io:

The --deployment flag activates a number of deployment-friendly conventions:
Isolate all gems into vendor/bundle

which does not work in my case. Any thing am I doing wrong?

1

There are 1 answers

0
aadarshsg On BEST ANSWER

bundle install will grab the gems from rubygems when run.

bundle package grabs the gems and packages them in vendor/cache.

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.

http://bundler.io/bundle_package.html