使用Capistrano定义捆绑路径 [英] Define Bundle Path With Capistrano

查看:148
本文介绍了使用Capistrano定义捆绑路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using the following configurations in my deploy.rb file for 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"
}

但是当我运行 cap deploy:update 时,我得到的是:

But when I run cap deploy:update I get this:

* 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参数)设置为我想要的样子。

That is, it's not setting the bundle path (the --path argument) to what I want it to be.

我尝试了许多教程,包括 rvm capistrano教程,但似乎无济于事。它会继续使用capistrano默认值。

I've tried a number of tutorials, including the rvm capistrano tutorial but nothing seems to work. It continues to use the capistrano default.

Capistrano还使用以下.bundler / config

Capistrano also creates an application with the following .bundler/config

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

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

Development Machine: Windows 7, bundler (1.0.22), capistrano (2.12.0), rvm-capistrano (1.2.7), rails (3.2.8), (no rvm)

生产:Debian,捆绑软件(1.2.1)(无capistrano),( no rvm-capistrano),rails(3.2.8),rvm 1.16.5

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

推荐答案

感谢 Joseph Holsten的博客我能够确定我的问题是我在需要'bundler / capistrano'之前没有在我的deploy.rb中定义捆绑程序变量。我还需要定义bundle_dir变量,以创建如下所示的代码:

Thanks to Joseph Holsten's blog I was able to ascertain my problem was I was not defining the bundler variables in my deploy.rb before I required 'bundler/capistrano'. I also needed to define the bundle_dir variable, to create code that looks like the following:

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'

这篇关于使用Capistrano定义捆绑路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆