定义捆绑路径以Capistrano的(Define Bundle Path With Capistr

2019-08-01 00:36发布

我使用在Capistrano的我deploy.rb文件进行如下配置:

require 'bundler/capistrano'
require 'rvm/capistrano'

set :bundle_cmd, "/home/deployment/.rvm/gems/ruby-1.9.3-p194@global/bin/bundle"

set :default_environment, {
    'PATH' => "/home/deployment/.rvm/gems/ruby-1.9.3-p194/bin:/home/deployment/.rvm/bin:$PATH",
    'RUBY_VERSION' => 'ruby 1.9.3',
    'GEM_HOME' => "/home/deployment/.rvm/gems/ruby-1.9.3-p194",
    'GEM_PATH' => "/home/deployment/.rvm/gems/ruby-1.9.3-p194",
    'BUNDLE_PATH' => "/home/deployment/.rvm/gems/ruby-1.9.3-p194"
}

但是,当我运行cap deploy:update我得到这个:

* executing "cd /var/www/currienet/marketplace/releases/20120928140140 && /home/deployment/.rvm/gems/ruby-1.9.3-p194@global/bin/bundle install --gemfile /var/www/currienet/marketplace/releases/20120928140140/Gemfile --path /var/www/currienet/marketplace/shared/bundle --deployment --quiet --without development test"

也就是说,它不是包路径(--path参数)设置为我希望它是。

我已经尝试了一些教程,包括RVM Capistrano的教程 ,但似乎没有任何工作。 它继续使用Capistrano的默认。

斯特拉努还创建具有以下.bundler / config中的应用

BUNDLE_FROZEN: '1'
BUNDLE_PATH: /var/www/currienet/marketplace/shared/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'
BUNDLE_WITHOUT: development:test

开发机:Windows 7中捆绑(1.0.22),Capistrano的(2.12.0),RVM-Capistrano酒店(1.2.7),导轨(3.2.8),(无RVM)

制作:Debian的,捆绑(1.2.1)(无Capistrano的),(无RVM-Capistrano酒店),导轨(3.2.8),RVM 1.16.5

Answer 1:

由于约瑟夫霍尔斯滕的博客 ,我能够确定我的问题是,我没有在我deploy.rb定义捆绑变量之前我需要“捆绑/ Capistrano的”。 我还需要定义bundle_dir变量,创建代码如下所示:

set :bundle_cmd, "/home/deployment/.rvm/gems/ruby-1.9.3-p194@global/bin/bundle"
set :bundle_dir, "/home/deployment/.rvm/gems/ruby-1.9.3-p194"

require 'bundler/capistrano'


文章来源: Define Bundle Path With Capistrano