3

When deploying with Capistrano I want to use installed gems instead of installing them into vendor.

Capistrano seems to ignore .gemrc & .bashrc, so 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 gems are located in /some_path/.gem/gems, bin: /some_path/.gem/bin.

pex
  • 7,351
  • 4
  • 32
  • 41

4 Answers4

3

If you are doing

require 'bundler/capistrano'

Put this in deploy.rb to set bundle install's --path arg:

set :bundle_dir, "/path/to/gems"
Gurpartap Singh
  • 2,744
  • 1
  • 26
  • 30
3

Here's what I have in my config/deploy.rb to tell bundler to install gems into "system" gems:

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/

Paweł Gościcki
  • 9,066
  • 5
  • 70
  • 81
2

You can tell bundler where gems should go (or are I believe) and pass the --local to install from the local gem caches as opposed to fetching from http://rubygems.org

bundle install --local --path='/some_path/.gem
lebreeze
  • 5,094
  • 26
  • 34
1

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