2012-09-28 66 views
3

我用我deploy.rb文件以下配置为Capistrano的:定义捆绑路径以Capistrano的

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

set :bundle_cmd, "/home/deployment/.rvm/gems/[email protected]/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/[email protected]/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 tutorial但似乎没有任何工作。它继续使用capistrano默认值。

斯特拉努还创建一个具有以下.bundler的应用程序/配置

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 ),rails(3.2.8),(no rvm)

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

回答

8

感谢Joseph Holsten's blog我能确定我的问题是我没有定义在我DEPL所述捆绑变量oy.rb在我需要'bundler/capistrano'之前。我还需要定义bundle_dir变量,创建代码如下所示:

set :bundle_cmd, "/home/deployment/.rvm/gems/[email protected]/bin/bundle" 
set :bundle_dir, "/home/deployment/.rvm/gems/ruby-1.9.3-p194" 

require 'bundler/capistrano' 
相关问题