Capistrano: Use Bundle Gems from the Standard Gem-Home

When deploying with Capistrano, I want to use installed stones instead of installing them in vendor.

Capistrano seems to ignore .gemrcand .bashrc, therefore, I tried this in deploy.rb:

require 'bundler/capistrano'

set :default_environment, {
  'GEM_HOME'     => '/some_path/.gem',
  'GEM_PATH'     => '/some_path/.gem',
  'BUNDLE_PATH'  => '/some_path/.gem'
}

My jewels are /some_path/.gem/gems, bin directory: /some_path/.gem/bin.

+3
source share
4 answers

You can tell the binder where the stones should go (or, I suppose), and pass -local to install from the local cache, not from http://rubygems.org

bundle install --local --path='/some_path/.gem
+2
source

If you do

require 'bundler/capistrano'

Put this in deploy.rb to install the package installation - path arg:

set :bundle_dir, "/path/to/gems"
+3
source

config/deploy.rb, "" :

require "bundler/capistrano"
set :bundle_dir,     ""         # install into "system" gems
set :bundle_flags,   "--quiet"  # no verbose output
set :bundle_without, []         # bundle all gems (even dev & test)

http://paulgoscicki.com/archives/2011/10/tell-bundler-to-install-gems-globally-when-using-capistrano/

+3
source

This is a manifestation of the switch of the YAML core from Syck to Psych and all the incompatibilities it brought. The problem is that now you have to reinstall all your gems, because all installed gems have the wrong gemspec specification.

+1
source

Source: https://habr.com/ru/post/1788002/


All Articles