0

我一直在与 Capistrano 搏斗,尝试部署一个测试 Rails 应用程序几天,我我快到了,但是当我运行时出现这个错误cap deploy

failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'default' -c 'cd var/rails/test_app/current/releases/20120619215252 && bundle install --gemfile var/rails/test_app/current/releases/20120619215252/Gemfile --path var/rails/test_app/current/shared/bundle --deployment --quiet --without development test'" on my.vps.ip.address

这是什么意思,我该如何解决这个问题?

谢谢!

这是我的 deploy.rb 文件,如果有帮助的话:

# RVM

$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, 'default'
set :rvm_type, :system

# Bundler

require "bundler/capistrano"

# General

set :application, "test_app"
set :user, "rails"

set :deploy_to, "var/rails/test_app/current"
set :deploy_via, :copy

set :use_sudo, false

# Git

set :scm, :git
set :repository,  "~/Projects/test_app/.git"
set :branch, "master"

# VPS

role :web, "my.vps.ip.address"
role :app, "my.vps.ip.address"
role :db,  "my.vps.ip.address", :primary => true
role :db,  "my.vps.ip.address"

# Passenger

namespace :deploy do
 task :start do ; end
 task :stop do ; end
 task :restart, :roles => :app, :except => { :no_release => true } do
  run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
 end
end
4

1 回答 1

2

Capistrano 正在尝试进入最新的部署文件夹并运行“捆绑安装”。问题似乎是 capistrano 尝试执行此操作的文件夹:您正在执行cd var/rails/test_app/current/releases/20120619215252 && bundle install ... A / 在路径的开头丢失,应该是 /var/rails ...您应该在覆盖路径中的某个位置时犯了一个错误食谱。

看到你应该有的食谱(注意/)

set :deploy_to, "/var/rails/test_app/"

不要指定“当前”文件夹,这是 capistrano 的默认行为。确保 /var/rails/test_app/ 归用于部署的用户所有。其他:chown -R rails:rails /var/rails/test_app/ rails:rails,因为你set :user, "rails"在你的食谱中。

也不要忘记cap deploy:setup建立目录结构......

于 2012-06-19T22:13:41.250 回答