2012-09-28 117 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' 
相關問題