[英]Having problems with setting up my Capistrano with Rails
我正在尝试使用 Capistrano 部署我的 Rails 应用程序。
我的 deploy.rb 文件如下所示:
require "bundler/capistrano"
server "xx.xx.xxx.xxx", :web, :db, :primary => true
set :application, "myApp"
set :user, "ubuntu"
set :deploy_to, "/home/#{user}/apps/#{application}"
#set :deploy_via, :remote_cache
set :migrate_target, :current
set :keep_releases, 3
set :scm, "git"
set :repository, "git@github.com:name/#{application}.git"
set :branch, "master"
set :use_sudo, false
default_run_options[:pty] = true
# default_run_options[:shell] = '/bin/bash'
ssh_options[:forward_agent] = true
ssh_options[:keys] = ["#{ENV['HOME']}/.ec2/keypair.pem"]
现在每当我尝试做
cap deploy:cold
我收到如下错误:
https://gist.github.com/c54933142b900f9f93b9
任何帮助,将不胜感激 。
我看到的唯一我不认识的是set :migrate_target :current
—— 这可能是默认的或隐含的,所以也许没什么好担心的,但你的要点的根本错误是
** [out :: xx.xx.xxx.xxx] rm:
** [out :: xx.xx.xxx.xxx] cannot remove `/home/ubuntu/apps/myApp/current'
** [out :: xx.xx.xxx.xxx] : Is a directory
current
应该是一个符号链接,而不是一个目录,所以很难知道它是如何成为目录的。
我会登录到服务器,更改为/home/ubuntu/apps/myApp/
然后rm -rf current
。 从那里您可以手动创建预期的符号链接(当前将链接到名称为日期/时间的目录),或者从您的本地机器返回运行cap deploy:create_symlink
然后尝试常规部署。
我认为可以公平地说,capistrano 初始化并不是它的强项——一旦你开始工作,它往往会非常棒,在此之前,更多的是令人气愤的迟钝。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.