用Capistrano定义Bundle路径

Dr.*_*uss 3 capistrano bundler rvm

我在deploy.rb文件中使用以下配置为capistrano:

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"
}
Run Code Online (Sandbox Code Playgroud)

但是当我跑步时,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"
Run Code Online (Sandbox Code Playgroud)

也就是说,它没有将bundle路径(--path参数)设置为我想要的路径.

我已经尝试了很多教程,包括rvm capistrano教程,但似乎没有任何工作.它继续使用capistrano默认值.

Capistrano还使用以下.bundler/config创建应用程序

BUNDLE_FROZEN: '1'
BUNDLE_PATH: /var/www/currienet/marketplace/shared/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'
BUNDLE_WITHOUT: development:test
Run Code Online (Sandbox Code Playgroud)

开发机器:Windows 7,捆绑器(1.0.22),capistrano(2.12.0),rvm-capistrano(1.2.7),rails(3.2.8),(无rvm)

制作:Debian,bundler(1.2.1)(没有capistrano),(没有rvm-capistrano),rails(3.2.8),rvm 1.16.5

Dr.*_*uss 8

感谢Joseph Holsten的博客,我能够确定我的问题是在我需要'bundler/capistrano'之前,我没有在deploy.rb中定义捆绑变量.我还需要定义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'
Run Code Online (Sandbox Code Playgroud)